From: Benoit Gschwind Date: Wed, 20 Feb 2008 23:14:45 +0000 (+0100) Subject: frame_show/hide is now in ObClient X-Git-Tag: plugin~17 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=c96e15e21c63cead120e0506e97811f6550abb63;p=dana%2Fopenbox.git frame_show/hide is now in ObClient --- diff --git a/engines/default/plugin.c b/engines/default/plugin.c index fad3e60d..188a9801 100644 --- a/engines/default/plugin.c +++ b/engines/default/plugin.c @@ -261,38 +261,6 @@ void frame_free(gpointer self) g_free(self); } -void frame_show(gpointer _self) -{ - ObDefaultFrame * self = (ObDefaultFrame *) _self; - if (!self->visible) { - self->visible = TRUE; - frame_update_skin(self); - /* Grab the server to make sure that the frame window is mapped before - the client gets its MapNotify, i.e. to make sure the client is - _visible_ when it gets MapNotify. */ - grab_server(TRUE); - XMapWindow(obp_display, self->client->w_client); - XMapWindow(obp_display, self->window); - grab_server(FALSE); - } -} - -gint frame_hide(gpointer self) -{ - if (OBDEFAULTFRAME(self)->visible) { - OBDEFAULTFRAME(self)->visible = FALSE; - if (!frame_iconify_animating(self)) - XUnmapWindow(obp_display, OBDEFAULTFRAME(self)->window); - /* we unmap the client itself so that we can get MapRequest - events, and because the ICCCM tells us to! */ - XUnmapWindow(obp_display, OBDEFAULTFRAME(self)->client->w_client); - return 1; - } - else { - return 0; - } -} - void frame_adjust_theme(gpointer self) { free_theme_statics(self); @@ -1877,8 +1845,7 @@ init, //gint (*init) (Display * display, gint screen); 0, /* */ frame_new, //gpointer (*frame_new) (struct _ObClient *c); frame_free, //void (*frame_free) (gpointer self); - frame_show, //void (*frame_show) (gpointer self); - frame_hide, //void (*frame_hide) (gpointer self); + frame_adjust_theme, //void (*frame_adjust_theme) (gpointer self); frame_adjust_shape, //void (*frame_adjust_shape) (gpointer self); frame_grab, //void (*frame_adjust_area) (gpointer self, gboolean moved, gboolean resized, gboolean fake); diff --git a/openbox/client.c b/openbox/client.c index dace8036..1cf46785 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -681,7 +681,7 @@ void client_unmanage(ObClient *self) if (!config_focus_under_mouse) ignore_start = event_start_ignore_all_enters(); - self->ignore_unmaps += render_plugin->frame_hide(self->frame); + client_hide_frame(self); /* flush to send the hide to the server quickly */ XFlush(obt_display); @@ -2613,7 +2613,7 @@ gboolean client_show(ObClient *self) should be going to something under the window */ mouse_replay_pointer(); - render_plugin->frame_show(self->frame); + client_show_frame(self); show = TRUE; /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, @@ -2658,7 +2658,7 @@ gboolean client_hide(ObClient *self) should be going to the window */ mouse_replay_pointer(); - self->ignore_unmaps += render_plugin->frame_hide(self->frame); + client_hide_frame(self); hide = TRUE; /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, @@ -4471,3 +4471,28 @@ gboolean client_has_group_siblings(ObClient *self) { return self->group && self->group->members->next; } + +void client_show_frame(ObClient * self) +{ + render_plugin->frame_set_is_visible(self->frame, TRUE); + render_plugin->frame_update_layout(self->frame, FALSE, FALSE); + render_plugin->frame_update_skin(self->frame); + /* Grab the server to make sure that the frame window is mapped before + the client gets its MapNotify, i.e. to make sure the client is + _visible_ when it gets MapNotify. */ + grab_server(TRUE); + XMapWindow(obt_display, self->w_client); + XMapWindow(obt_display, self->w_frame); + grab_server(FALSE); +} + +void client_hide_frame(ObClient * self) +{ + render_plugin->frame_set_is_visible(self->frame, FALSE); + if (!render_plugin->frame_iconify_animating(self)) + XUnmapWindow(obt_display, self->w_frame); + /* we unmap the client itself so that we can get MapRequest + events, and because the ICCCM tells us to! */ + XUnmapWindow(obt_display, self->w_client); + self->ignore_unmaps++; +} diff --git a/openbox/client.h b/openbox/client.h index 2cceb618..209cdd11 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -728,4 +728,6 @@ ObClient* client_under_pointer(); gboolean client_has_group_siblings(ObClient *self); +void client_show_frame(ObClient *); +void client_hide_frame(ObClient *); #endif diff --git a/openbox/engine_interface.h b/openbox/engine_interface.h index 506b1f15..b23d6adf 100644 --- a/openbox/engine_interface.h +++ b/openbox/engine_interface.h @@ -135,9 +135,6 @@ struct _ObFramePlugin /* Free the frame */ void (*frame_free)(gpointer self); - void (*frame_show)(gpointer self); - gint (*frame_hide)(gpointer self); - void (*frame_adjust_theme)(gpointer self); void (*frame_adjust_shape)(gpointer self);