mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
make it possible to disable VisibilityTracker's use of WM visibility
This commit is contained in:
parent
207fa93cf9
commit
73f3abedea
5 changed files with 34 additions and 5 deletions
|
|
@ -35,6 +35,8 @@ class LIBGTKMM2EXT_API VisibilityTracker : public virtual sigc::trackable {
|
||||||
VisibilityTracker (Gtk::Window&);
|
VisibilityTracker (Gtk::Window&);
|
||||||
virtual ~VisibilityTracker() {}
|
virtual ~VisibilityTracker() {}
|
||||||
|
|
||||||
|
static void set_use_window_manager_visibility (bool);
|
||||||
|
static bool use_window_manager_visibility() { return _use_window_manager_visibility; }
|
||||||
void cycle_visibility ();
|
void cycle_visibility ();
|
||||||
|
|
||||||
bool fully_visible() const;
|
bool fully_visible() const;
|
||||||
|
|
@ -46,6 +48,9 @@ class LIBGTKMM2EXT_API VisibilityTracker : public virtual sigc::trackable {
|
||||||
private:
|
private:
|
||||||
Gtk::Window& _window;
|
Gtk::Window& _window;
|
||||||
GdkVisibilityState _visibility;
|
GdkVisibilityState _visibility;
|
||||||
|
|
||||||
|
static bool _use_window_manager_visibility;
|
||||||
|
|
||||||
bool handle_visibility_notify_event (GdkEventVisibility*);
|
bool handle_visibility_notify_event (GdkEventVisibility*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ class LIBGTKMM2EXT_API WindowProxy : public PBD::StatefulDestructible, public vi
|
||||||
sigc::connection delete_connection;
|
sigc::connection delete_connection;
|
||||||
sigc::connection configure_connection;
|
sigc::connection configure_connection;
|
||||||
|
|
||||||
|
|
||||||
void save_pos_and_size ();
|
void save_pos_and_size ();
|
||||||
void set_pos_and_size ();
|
void set_pos_and_size ();
|
||||||
void set_pos ();
|
void set_pos ();
|
||||||
|
|
|
||||||
|
|
@ -477,6 +477,7 @@ Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* /*win*/)
|
||||||
current_window = 0;
|
current_window = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
DEBUG_TRACE (DEBUG::Keyboard, "LEAVE window without event\n");
|
||||||
current_window = 0;
|
current_window = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -498,7 +499,9 @@ Keyboard::focus_out_window (GdkEventFocus * ev, Gtk::Window* win)
|
||||||
state.clear ();
|
state.clear ();
|
||||||
current_window = 0;
|
current_window = 0;
|
||||||
} else {
|
} else {
|
||||||
current_window = 0;
|
if (win == current_window) {
|
||||||
|
current_window = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Foucusing out window, title = %1\n", win->get_title()));
|
DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Foucusing out window, title = %1\n", win->get_title()));
|
||||||
|
|
|
||||||
|
|
@ -304,6 +304,7 @@ Tabbable::show_tab ()
|
||||||
add_to_notebook (*_parent_notebook, _tab_title);
|
add_to_notebook (*_parent_notebook, _tab_title);
|
||||||
}
|
}
|
||||||
_parent_notebook->set_current_page (_parent_notebook->page_num (_contents));
|
_parent_notebook->set_current_page (_parent_notebook->page_num (_contents));
|
||||||
|
current_toplevel()->present ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
using namespace Gtkmm2ext;
|
using namespace Gtkmm2ext;
|
||||||
|
|
||||||
|
bool VisibilityTracker::_use_window_manager_visibility = true;
|
||||||
|
|
||||||
VisibilityTracker::VisibilityTracker (Gtk::Window& win)
|
VisibilityTracker::VisibilityTracker (Gtk::Window& win)
|
||||||
: _window (win)
|
: _window (win)
|
||||||
, _visibility (GdkVisibilityState (0))
|
, _visibility (GdkVisibilityState (0))
|
||||||
|
|
@ -31,11 +33,16 @@ VisibilityTracker::VisibilityTracker (Gtk::Window& win)
|
||||||
_window.signal_visibility_notify_event().connect (sigc::mem_fun (*this, &VisibilityTracker::handle_visibility_notify_event));
|
_window.signal_visibility_notify_event().connect (sigc::mem_fun (*this, &VisibilityTracker::handle_visibility_notify_event));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
VisibilityTracker::set_use_window_manager_visibility (bool yn)
|
||||||
|
{
|
||||||
|
_use_window_manager_visibility = yn;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
VisibilityTracker::handle_visibility_notify_event (GdkEventVisibility* ev)
|
VisibilityTracker::handle_visibility_notify_event (GdkEventVisibility* ev)
|
||||||
{
|
{
|
||||||
_visibility = ev->state;
|
_visibility = ev->state;
|
||||||
// std::cerr << "VT: " << _window.get_title() << " vis event, fv = " << fully_visible() << " pv = " << partially_visible() << " nv = " << not_visible() << std::endl;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,17 +59,29 @@ VisibilityTracker::cycle_visibility ()
|
||||||
bool
|
bool
|
||||||
VisibilityTracker::fully_visible () const
|
VisibilityTracker::fully_visible () const
|
||||||
{
|
{
|
||||||
return _window.is_mapped() && (_visibility == GDK_VISIBILITY_UNOBSCURED);
|
if (_use_window_manager_visibility) {
|
||||||
|
return _window.is_mapped() && (_visibility == GDK_VISIBILITY_UNOBSCURED);
|
||||||
|
} else {
|
||||||
|
return _window.is_mapped();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
VisibilityTracker::not_visible () const
|
VisibilityTracker::not_visible () const
|
||||||
{
|
{
|
||||||
return !_window.is_mapped() || (_visibility == GDK_VISIBILITY_FULLY_OBSCURED);
|
if (_use_window_manager_visibility) {
|
||||||
|
return !_window.is_mapped() || (_visibility == GDK_VISIBILITY_FULLY_OBSCURED);
|
||||||
|
} else {
|
||||||
|
return !_window.is_mapped();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
VisibilityTracker::partially_visible () const
|
VisibilityTracker::partially_visible () const
|
||||||
{
|
{
|
||||||
return _window.is_mapped() && ((_visibility == GDK_VISIBILITY_PARTIAL) || (_visibility == GDK_VISIBILITY_UNOBSCURED));
|
if (_use_window_manager_visibility) {
|
||||||
|
return _window.is_mapped() && ((_visibility == GDK_VISIBILITY_PARTIAL) || (_visibility == GDK_VISIBILITY_UNOBSCURED));
|
||||||
|
} else {
|
||||||
|
return _window.is_mapped();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue