defer creating a visibility tracker for a window until the window is mapped
Without this, the visibility tracker will report that the window is not visible at startup, and this overrides the XML _visible property which denotes that the window should be made visible
This commit is contained in:
parent
b9d8f75119
commit
d48dd0ccd5
@ -27,8 +27,9 @@ 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 (GDK_VISIBILITY_FULLY_OBSCURED)
|
||||||
{
|
{
|
||||||
|
std::cerr << " vis tracker for " << _window.get_title() << " created\n";
|
||||||
_window.add_events (Gdk::VISIBILITY_NOTIFY_MASK);
|
_window.add_events (Gdk::VISIBILITY_NOTIFY_MASK);
|
||||||
_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));
|
||||||
}
|
}
|
||||||
@ -42,7 +43,9 @@ VisibilityTracker::set_use_window_manager_visibility (bool yn)
|
|||||||
bool
|
bool
|
||||||
VisibilityTracker::handle_visibility_notify_event (GdkEventVisibility* ev)
|
VisibilityTracker::handle_visibility_notify_event (GdkEventVisibility* ev)
|
||||||
{
|
{
|
||||||
|
std::cerr << _window.get_title() << " VISIBILITY CHANGE " << " from " << _visibility;
|
||||||
_visibility = ev->state;
|
_visibility = ev->state;
|
||||||
|
std::cerr << " to " << _visibility << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,8 +83,10 @@ bool
|
|||||||
VisibilityTracker::partially_visible () const
|
VisibilityTracker::partially_visible () const
|
||||||
{
|
{
|
||||||
if (_use_window_manager_visibility) {
|
if (_use_window_manager_visibility) {
|
||||||
|
std::cerr << _window.get_title() << " pvis from vis = " << _visibility << " mapped " << _window.is_mapped() << std::endl;
|
||||||
return _window.is_mapped() && ((_visibility == GDK_VISIBILITY_PARTIAL) || (_visibility == GDK_VISIBILITY_UNOBSCURED));
|
return _window.is_mapped() && ((_visibility == GDK_VISIBILITY_PARTIAL) || (_visibility == GDK_VISIBILITY_UNOBSCURED));
|
||||||
} else {
|
} else {
|
||||||
|
std::cerr << _window.get_title() << " pvis from mapped " << _window.is_mapped() << std::endl;
|
||||||
return _window.is_mapped();
|
return _window.is_mapped();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user