]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
get rid of the fullscreen below layer. its the same as maximized windows..
[chaz/openbox] / openbox / client.c
index 16c249378c3ec85de487e72b5b1c8b64e817bb25..e51ad65eba00d29cb0c8df196979dabaa4de5122 100644 (file)
@@ -65,7 +65,6 @@ typedef struct
 GList            *client_list          = NULL;
 
 static GSList *client_destroy_notifies = NULL;
-static GSList *client_hide_notifies    = NULL;
 
 static void client_get_all(ObClient *self, gboolean real);
 static void client_toggle_border(ObClient *self, gboolean show);
@@ -139,29 +138,6 @@ void client_remove_destroy_notify(ObClientCallback func)
     }
 }
 
-void client_add_hide_notify(ObClientCallback func, gpointer data)
-{
-    ClientCallback *d = g_new(ClientCallback, 1);
-    d->func = func;
-    d->data = data;
-    client_hide_notifies = g_slist_prepend(client_hide_notifies, d);
-}
-
-void client_remove_hide_notify(ObClientCallback func)
-{
-    GSList *it;
-
-    for (it = client_hide_notifies; it; it = g_slist_next(it)) {
-        ClientCallback *d = it->data;
-        if (d->func == func) {
-            g_free(d);
-            client_hide_notifies =
-                g_slist_delete_link(client_hide_notifies, it);
-            break;
-        }
-    }
-}
-
 void client_set_list()
 {
     Window *windows, *win_it;
@@ -2367,12 +2343,9 @@ static ObStackingLayer calc_layer(ObClient *self)
                 self->frame->size.bottom == 0 && self->frame->size.top == 0 &&
                 RECT_EQUAL(self->area,
                            *screen_physical_area_monitor
-                           (client_monitor(self))))))) {
-        if (client_focused(self) || client_search_focus_tree(self))
-            l = OB_STACKING_LAYER_FULLSCREEN;
-        else
-            l = OB_STACKING_LAYER_FULLSCREEN_BELOW;
-    }
+                           (client_monitor(self)))))) &&
+             (client_focused(self) || client_search_focus_tree(self)))
+        l = OB_STACKING_LAYER_FULLSCREEN;
     else if (self->above) l = OB_STACKING_LAYER_ABOVE;
     else if (self->below) l = OB_STACKING_LAYER_BELOW;
     else l = OB_STACKING_LAYER_NORMAL;
@@ -2442,12 +2415,9 @@ void client_show(ObClient *self)
 
 void client_hide(ObClient *self)
 {
-    if (!client_should_show(self)) {
+    if (!client_should_show(self))
         frame_hide(self->frame);
 
-        client_call_notifies(self, client_hide_notifies);
-    }
-
     /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
        needs to be in IconicState. This includes when it is on another
        desktop!
@@ -2458,15 +2428,11 @@ void client_hide(ObClient *self)
 void client_showhide(ObClient *self)
 {
 
-    if (client_should_show(self)) {
+    if (client_should_show(self))
         frame_show(self->frame);
-    }
-    else {
+    else
         frame_hide(self->frame);
 
-        client_call_notifies(self, client_hide_notifies);
-    }
-
     /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
        needs to be in IconicState. This includes when it is on another
        desktop!
@@ -3355,6 +3321,8 @@ gboolean client_can_focus(ObClient *self)
 
 gboolean client_focus(ObClient *self)
 {
+    gboolean error;
+
     /* choose the correct target */
     self = client_focus_target(self);
 
@@ -3380,13 +3348,14 @@ gboolean client_focus(ObClient *self)
     if (keyboard_interactively_grabbed())
         keyboard_interactive_cancel();
 
+    error = FALSE;
+    xerror_set_ignore(TRUE);
+
     if (self->can_focus) {
         /* This can cause a BadMatch error with CurrentTime, or if an app
            passed in a bad time for _NET_WM_ACTIVE_WINDOW. */
-        xerror_set_ignore(TRUE);
         XSetInputFocus(ob_display, self->window, RevertToPointerRoot,
                        event_curtime);
-        xerror_set_ignore(FALSE);
     }
 
     if (self->focus_notify) {
@@ -3404,17 +3373,13 @@ gboolean client_focus(ObClient *self)
         XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);
     }
 
-#ifdef DEBUG_FOCUS
-    ob_debug("%sively focusing %lx at %d\n",
-             (self->can_focus ? "act" : "pass"),
-             self->window, (gint) event_curtime);
-#endif
+    /* This calls XSync, which will cause the FocusIn to come back to us.
+       That's important for desktop switches, since otherwise we'll have no
+       FocusIn on the queue and end up falling back again. */
+    xerror_set_ignore(FALSE);
+    if (!xerror_occured) error = TRUE;
 
-    /* Cause the FocusIn to come back to us. Important for desktop switches,
-       since otherwise we'll have no FocusIn on the queue and send it off to
-       the focus_backup. */
-    XSync(ob_display, FALSE);
-    return TRUE;
+    return !error;
 }
 
 /*! Present the client to the user.
This page took 0.023691 seconds and 4 git commands to generate.