Skip to content

Commit

Permalink
avoid "GtkWarning: IA__gtk_window_set_type_hint: assertion `!gtk_widg…
Browse files Browse the repository at this point in the history
…et_get_mapped": only set the window's type_hint before the window is mapped

git-svn-id: https://xpra.org/svn/Xpra/trunk@1269 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 4, 2012
1 parent d652eab commit f7b880e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/xpra/client_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def init_window(win, wintype):
#TODO: no idea how to do this with gtk3
#maybe not even possible..
gtk.Window.__init__(win)
def is_mapped(win):
return win.get_mapped()
def get_window_geometry(gtkwindow):
x, y = gtkwindow.get_position()
w, h = gtkwindow.get_size()
Expand Down Expand Up @@ -70,6 +72,8 @@ def queue_draw(window, x, y, width, height):
else:
def init_window(gtkwindow, wintype):
gtk.Window.__init__(gtkwindow, wintype)
def is_mapped(win):
return win.window is not None and win.window.is_visible()
def get_window_geometry(gtkwindow):
gdkwindow = gtkwindow.get_window()
x, y = gdkwindow.get_origin()
Expand Down Expand Up @@ -249,7 +253,8 @@ def metadata_replace(match):
if window:
self.set_transient_for(window)

if "window-type" in self._metadata:
#apply window-type hint if window is not mapped yet:
if "window-type" in self._metadata and not is_mapped(self):
window_types = self._metadata.get("window-type")
log("window types=%s", window_types)
for window_type in window_types:
Expand Down

0 comments on commit f7b880e

Please sign in to comment.