X-Git-Url: https://www.irasnyder.com/gitweb/?p=tilda-gobject.git;a=blobdiff_plain;f=tilda-window.c;h=731739b66aa96755e82cd432e66c4f1900d50f98;hp=6c413402d06064e5577e837627595058b8739c9a;hb=aa83ab57bb0931524a6941fbe8846f584cc26156;hpb=680f0bb1b2b86c21482704cf14e71b66f357883f 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;