From 5deea76d553c717246f5fb5fe717f3aa37f2a904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Fri, 4 Dec 2015 00:57:19 +0100 Subject: [PATCH] ui.backend.gtk: set the active? to 100 in on-map, should fix #1506 what now happens is that configure events are skipped until the first on-map signal is fired. seem to work fine in a variety of wm:s. if this works well we can return active? to be plain boolean. --- basis/ui/backend/gtk/gtk-docs.factor | 2 +- basis/ui/backend/gtk/gtk.factor | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/basis/ui/backend/gtk/gtk-docs.factor b/basis/ui/backend/gtk/gtk-docs.factor index 32d962ffeb..de069ee1e3 100644 --- a/basis/ui/backend/gtk/gtk-docs.factor +++ b/basis/ui/backend/gtk/gtk-docs.factor @@ -13,4 +13,4 @@ HELP: on-configure { "user-data" alien } { "?" boolean } } -{ $description "Handles a configure event (" { $link GdkEventConfigure } " sent from the windowing system. The world is activated if it isn't already and a map event has been received. Then it is relayouted." } ; +{ $description "Handles a configure event (" { $link GdkEventConfigure } " sent from the windowing system. If the world has been sent the on-map event from gtk then it is relayouted, otherwise nothing happens." } ; diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index 0263840425..a10ad511c5 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -257,18 +257,18 @@ CONSTANT: action-key-codes 2drop window relayout t ; : on-configure ( win event user-data -- ? ) - drop swap window dup active?>> 50 >= [ - 100 >>active? swap GdkEventConfigure memory>struct + drop swap window dup active?>> 100 = [ + swap GdkEventConfigure memory>struct [ event-loc >>window-loc ] [ event-dim >>dim ] bi relayout-1 ] [ 2drop ] if f ; +: on-map ( win event user-data -- ? ) + 2drop window 100 >>active? drop t ; + : on-delete ( win event user-data -- ? ) 2drop window ungraft t ; -: on-map ( win event user-data -- ? ) - 2drop window 50 >>active? drop t ; - :: connect-win-state-signals ( win -- ) win "expose-event" [ on-expose yield ] GtkWidget:expose-event connect-signal