Skip to content

Commit

Permalink
#2457 GTK3 requires a widget to apply the size hints
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@24380 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 4, 2019
1 parent 8a77bb2 commit 21d550b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/tests/xpra/test_apps/test_window_xterm_size_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def main():
w.set_default_size(499, 316)
w.set_title("xterm size hints")
w.connect("delete_event", Gtk.main_quit)
da = Gtk.DrawingArea()
w.add(da)
geom = Gdk.Geometry()
wh = Gdk.WindowHints
geom.min_width = 25
Expand All @@ -28,8 +30,7 @@ def main():
geom.max_height = 32764
mask |= wh.MAX_SIZE
gdk_hints = Gdk.WindowHints(mask)
w.set_geometry_hints(None, geom, gdk_hints)
da = Gtk.DrawingArea()
w.set_geometry_hints(da, geom, gdk_hints)
#da.connect("click", show)
def configure_event(w, event):
#print("configure_event(%s, %s)" % (w, event))
Expand All @@ -38,9 +39,8 @@ def configure_event(w, event):
x, y = gdkwindow.get_origin()[1:]
w, h = w.get_size()
print("drawing area geometry: %s" % ((x, y, w, h),))
w.connect("configure_event", configure_event)
w.add(da)
w.show_all()
w.connect("configure_event", configure_event)
Gtk.main()


Expand Down
2 changes: 2 additions & 0 deletions src/xpra/client/gl/gtk3/gl_client_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ def new_backing(self, bw, bh):
self.init_widget_events(widget)
self.add(widget)
self.drawing_area = widget
#maybe redundant?:
self.apply_geometry_hints(self.geometry_hints)
2 changes: 1 addition & 1 deletion src/xpra/client/gtk3/gtk3_client_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def apply_geometry_hints(self, hints):
mask |= int(name_to_hint.get(k, 0))
gdk_hints = Gdk.WindowHints(mask)
geomlog("apply_geometry_hints(%s) geometry=%s, hints=%s", hints, geom, gdk_hints)
self.set_geometry_hints(None, geom, gdk_hints)
self.set_geometry_hints(self.drawing_area, geom, gdk_hints)

def queue_draw_area(self, x, y, width, height):
window = self.get_window()
Expand Down

0 comments on commit 21d550b

Please sign in to comment.