]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.backend.gtk: tune the order of the setup tasks in (open-window)
authorBjörn Lindqvist <bjourne@gmail.com>
Tue, 13 Oct 2015 22:22:26 +0000 (00:22 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Tue, 13 Oct 2015 22:22:26 +0000 (00:22 +0200)
The fix for #1307 made bug #776 come back. Apparently gtk is kind of
britle so the widget setup must be done in a very specific order.

basis/ui/backend/gtk/gtk.factor

index 50f00a43f215d0571bf7438cfb89b422ebcc794a..8b82e18e9b5faf1fa85fe4af0338645f1eaaeb65 100644 (file)
@@ -1,17 +1,15 @@
 ! Copyright (C) 2010, 2011 Anton Gorenko, Philipp Bruschweiler.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.accessors alien.c-types alien.data
-alien.strings arrays assocs classes.struct command-line
-continuations destructors environment gdk.ffi gdk.gl.ffi
-gdk.pixbuf.ffi glib.ffi gobject-introspection.standard-types
-gobject.ffi gtk.ffi gtk.gl.ffi io io.encodings.binary
-io.encodings.utf8 io.files kernel libc literals locals math
-math.bitwise math.order math.vectors namespaces sequences
-strings system threads ui ui.backend
-ui.backend.gtk.input-methods ui.backend.gtk.io ui.clipboards
-ui.event-loop ui.gadgets ui.gadgets.private ui.gadgets.worlds
-ui.gestures ui.pixel-formats ui.pixel-formats.private ui.private
-vocabs.loader combinators ;
+alien.strings arrays assocs classes.struct combinators continuations
+destructors environment gdk.ffi gdk.gl.ffi gdk.pixbuf.ffi glib.ffi
+gobject-introspection.standard-types gobject.ffi gtk.ffi gtk.gl.ffi
+io.encodings.binary io.encodings.utf8 io.files kernel libc literals
+locals math math.bitwise math.vectors namespaces sequences strings
+system threads ui ui.backend ui.backend.gtk.input-methods
+ui.backend.gtk.io ui.clipboards ui.event-loop ui.gadgets
+ui.gadgets.private ui.gadgets.worlds ui.gestures ui.pixel-formats
+ui.pixel-formats.private ui.private vocabs.loader ;
 IN: ui.backend.gtk
 
 SINGLETON: gtk-ui-backend
@@ -467,13 +465,18 @@ M:: gtk-ui-backend (open-window) ( world -- )
     gtk_window_set_wmclass
 
     world configure-gl
+
+    ! This must be done before realize due to #776.
+    win events-mask gtk_widget_add_events
+
     win gtk_widget_realize
 
+    ! And this must be done after and in this order due to #1307
     win im configure-im
     win connect-user-input-signals
     win connect-win-state-signals
-    win world window-controls>> configure-window-controls
 
+    win world window-controls>> configure-window-controls
     win gtk_widget_show_all ;
 
 M: gtk-ui-backend (close-window) ( handle -- )