From aa83ab57bb0931524a6941fbe8846f584cc26156 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Thu, 17 Jan 2008 16:55:32 -0800 Subject: [PATCH] [Window] Bugfixes in pull() code This fixes numerous bugs in the pull() code. Some window properties were being reset by Metacity when the window was hidden, so we must re-set them every single time the window is re-shown. Lame. Also, Metacity iconified (minimized) the window if it was pulled down on one workspace, pulled up while on another workspace, then pulled down on the current workspace. We'll have to work around that (stupid) behavior too. Doubly lame. --- tilda-window.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/tilda-window.c b/tilda-window.c index 6c41340..731739b 100644 --- a/tilda-window.c +++ b/tilda-window.c @@ -167,19 +167,35 @@ tilda_window_keybinding_cb (const gchar *keystr, gpointer data) switch (self->state) { - case WINDOW_UP: - /* Pull Down */ - tomboy_window_present_hardcore (GTK_WINDOW(self->window)); - self->state = WINDOW_DOWN; - - // Focusing the term here works perfectly, near as I can tell + case WINDOW_UP: /* Pull the window up */ + + /* Bugfix: having this here keeps the tilda window from being + * hidden if you turn off "stick", pull it down on workspace 1, + * switch to workspace 2, then pull it up and back down. Without + * this, something in metacity (at least) hides the window. Stupid. */ + gtk_window_deiconify (GTK_WINDOW(self->window)); + + /* Re-set the window properties that do not linger after hiding the + * window. I know this looks stupid, but it keeps all of the state- + * changing code in the place it belongs: the property-setting code. */ + g_object_set (G_OBJECT(self), + "keep-above", self->keep_above, + "stick", self->stick, + NULL); + gtk_window_present_with_time (GTK_WINDOW(self->window), + tomboy_keybinder_get_current_event_time()); + + /* Focusing the term here works perfectly, near as I can tell */ tt = tilda_window_find_current_terminal (self); gtk_widget_grab_focus (GTK_WIDGET(tt->vte_term)); + + self->state = WINDOW_DOWN; break; - case WINDOW_DOWN: - /* Pull Up */ + case WINDOW_DOWN: /* Pull the window up */ + gtk_widget_hide (GTK_WIDGET(self->window)); + self->state = WINDOW_UP; break; -- 2.25.1