frame_show/hide is now in ObClient
authorBenoit Gschwind <doth.gschwind@gmail.com>
Wed, 20 Feb 2008 23:14:45 +0000 (00:14 +0100)
committerDana Jansens <danakj@orodu.net>
Thu, 21 Feb 2008 17:06:24 +0000 (12:06 -0500)
engines/default/plugin.c
openbox/client.c
openbox/client.h
openbox/engine_interface.h

index fad3e60de9f5dedad2d40385f7e011c959aadc73..188a98013f00e28a468b884a25d61ee9c8c2c176 100644 (file)
@@ -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);
index dace803639d84a6a5ba33f7e6aab1c6682d8a035..1cf46785723dd1b3e312d295ff82aa75aab01f03 100644 (file)
@@ -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++;
+}
index 2cceb6189b4aae8d436ae6c8f319b6cd199eae44..209cdd11c0e93d696bfa04e8ac9ede2b487a89dd 100644 (file)
@@ -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
index 506b1f15fd29c0f52978ef96fe031fe674edc066..b23d6adf659e034ec3e15b5c7ed252f75bbe4372 100644 (file)
@@ -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);