fix save+restore of Gtkmm2ext::Tearoff state; a few cerr cleanups
git-svn-id: svn://localhost/ardour2/branches/3.0@6823 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2ad3940b54
commit
38575cd805
@ -3288,8 +3288,6 @@ Session::next_return_id ()
|
||||
void
|
||||
Session::mark_send_id (uint32_t id)
|
||||
{
|
||||
cerr << "Marking send ID " << id << " in use\n";
|
||||
|
||||
if (id >= send_bitset.size()) {
|
||||
send_bitset.resize (id+16, false);
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ class TearOff : public Gtk::HBox
|
||||
double drag_y;
|
||||
bool dragging;
|
||||
bool _visible;
|
||||
bool _torn;
|
||||
bool _can_be_torn_off;
|
||||
int own_window_width;
|
||||
int own_window_height;
|
||||
|
@ -35,14 +35,16 @@ using namespace Glib;
|
||||
using namespace std;
|
||||
|
||||
TearOff::TearOff (Widget& c, bool allow_resize)
|
||||
: contents (c),
|
||||
own_window (Gtk::WINDOW_TOPLEVEL),
|
||||
tearoff_arrow (ARROW_DOWN, SHADOW_OUT),
|
||||
close_arrow (ARROW_UP, SHADOW_OUT)
|
||||
: contents (c)
|
||||
, own_window (Gtk::WINDOW_TOPLEVEL)
|
||||
, tearoff_arrow (ARROW_DOWN, SHADOW_OUT)
|
||||
, close_arrow (ARROW_UP, SHADOW_OUT)
|
||||
, dragging (false)
|
||||
, _visible (true)
|
||||
, _torn (false)
|
||||
, _can_be_torn_off (true)
|
||||
|
||||
{
|
||||
dragging = false;
|
||||
_visible = true;
|
||||
_can_be_torn_off = true;
|
||||
own_window_width = 0;
|
||||
own_window_height = 0;
|
||||
own_window_xpos = 0;
|
||||
@ -111,7 +113,7 @@ TearOff::set_visible (bool yn)
|
||||
{
|
||||
/* don't change visibility if torn off */
|
||||
|
||||
if (own_window.is_visible()) {
|
||||
if (_torn) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -152,6 +154,9 @@ TearOff::tear_it_off ()
|
||||
own_window.show_all ();
|
||||
own_window.present ();
|
||||
hide ();
|
||||
|
||||
_torn = true;
|
||||
|
||||
Detach ();
|
||||
}
|
||||
|
||||
@ -174,6 +179,9 @@ TearOff::put_it_back ()
|
||||
reorder_child (contents, 0);
|
||||
own_window.hide ();
|
||||
show_all ();
|
||||
|
||||
_torn = false;
|
||||
|
||||
Attach ();
|
||||
}
|
||||
|
||||
@ -246,13 +254,13 @@ TearOff::window_motion (GdkEventMotion* ev)
|
||||
bool
|
||||
TearOff::torn_off() const
|
||||
{
|
||||
return own_window.is_visible();
|
||||
return _torn;
|
||||
}
|
||||
|
||||
void
|
||||
TearOff::add_state (XMLNode& node) const
|
||||
{
|
||||
node.add_property ("tornoff", (own_window.is_visible() ? "yes" : "no"));
|
||||
node.add_property ("tornoff", (_torn ? "yes" : "no"));
|
||||
|
||||
if (own_window_width > 0) {
|
||||
char buf[32];
|
||||
@ -279,10 +287,8 @@ TearOff::set_state (const XMLNode& node)
|
||||
}
|
||||
|
||||
if (prop->value() == "yes") {
|
||||
cerr << "Tearing off " << node.name() << endl;
|
||||
tear_it_off ();
|
||||
} else {
|
||||
cerr << "Putting back " << node.name() << endl;
|
||||
put_it_back ();
|
||||
}
|
||||
|
||||
@ -309,8 +315,6 @@ TearOff::set_state (const XMLNode& node)
|
||||
void
|
||||
TearOff::own_window_realized ()
|
||||
{
|
||||
cerr << "tearoff realized\n";
|
||||
|
||||
own_window.get_window()->set_decorations (WMDecoration (DECOR_BORDER|DECOR_RESIZEH));
|
||||
|
||||
if (own_window_width > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user