]> Dogcows Code - chaz/openbox/commitdiff
Merge branch 'backport' into work
authorMikael Magnusson <mikachu@comhem.se>
Sat, 8 Mar 2008 16:43:32 +0000 (17:43 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Sat, 8 Mar 2008 16:43:32 +0000 (17:43 +0100)
Conflicts:

obt/keyboard.c
openbox/actions/cyclewindows.c
openbox/actions/directionalwindows.c
openbox/frame.c
openbox/openbox.c

22 files changed:
openbox/actions.c
openbox/actions/cyclewindows.c
openbox/actions/desktop.c
openbox/actions/directionalwindows.c
openbox/client.c
openbox/config.h
openbox/event.c
openbox/focus.c
openbox/focus_cycle.c
openbox/frame.c
openbox/keyboard.c
openbox/keytree.h
openbox/menu.c
openbox/menuframe.c
openbox/moveresize.c
openbox/prompt.c
openbox/session.c
render/gradient.c
render/render.c
render/test.c
render/theme.c
tests/usertimewin.c

index 8f72714e9403026b55ddb5394b381ae941fd3fc6..1ec53287691b6748c8f31ad127024a7925d58922 100644 (file)
@@ -58,7 +58,6 @@ struct _ObActionsAct {
 
 static GSList *registered = NULL;
 
-
 void actions_startup(gboolean reconfig)
 {
     if (reconfig) return;
index 44d87cf6cf4a3fff0d3c0e34f6547b263030d375..5354f087c55254f5fdd5fd700a63e88a93ac6cc7 100644 (file)
@@ -75,7 +75,7 @@ static gpointer setup_func(xmlNodePtr node)
         m = obt_parse_find_node(n->children, "action");
         while (m) {
             ObActionsAct *action = actions_parse(m);
-            if (action) o->actions = g_slist_prepend(o->actions, action);
+            if (action) o->actions = g_slist_append(o->actions, action);
             m = obt_parse_find_node(m->next, "action");
         }
     }
index d5535f6cc20a8a38e31a6656310f2b84ee1ff1de..e1bd5520808f195f5e80e836ca26592c1aef5026 100644 (file)
@@ -118,8 +118,6 @@ static gboolean run_func(ObActionsData *data, gpointer options)
     Options *o = options;
     guint d;
 
-
-
     switch (o->type) {
     case LAST:
         d = screen_last_desktop;
index c5c25c11329b0aa7768df61a60f0c55597069fab..d3633d507356aff655be907e9414c3772e16954c 100644 (file)
@@ -91,7 +91,7 @@ static gpointer setup_func(xmlNodePtr node)
         m = obt_parse_find_node(n->children, "action");
         while (m) {
             ObActionsAct *action = actions_parse(m);
-            if (action) o->actions = g_slist_prepend(o->actions, action);
+            if (action) o->actions = g_slist_append(o->actions, action);
             m = obt_parse_find_node(m->next, "action");
         }
     }
index a055e6329176328f04053fae18c96e6b0019cda5..0ccb343b1ce32c0808eb914b2f30c75c5bd5ba6d 100644 (file)
@@ -108,7 +108,6 @@ static void client_call_notifies(ObClient *self, GSList *list);
 static void client_ping_event(ObClient *self, gboolean dead);
 static void client_prompt_kill(ObClient *self);
 
-
 void client_startup(gboolean reconfig)
 {
     if ((client_default_icon = RrImageCacheFind(ob_rr_icons,
@@ -583,7 +582,6 @@ void client_manage(Window window, ObPrompt *prompt)
     hooks_queue(OB_HOOK_WIN_NEW, self);
 }
 
-
 ObClient *client_fake_manage(Window window)
 {
     ObClient *self;
@@ -1310,7 +1308,6 @@ static void client_update_transient_tree(ObClient *self,
       transient windows as their children.
       * * */
 
-
     /* No change has occured */
     if (oldgroup == newgroup &&
         oldgtran == newgtran &&
@@ -2126,7 +2123,6 @@ void client_update_icons(ObClient *self)
                                        (gint*)&w, (gint*)&h, &data);
                 obt_display_ignore_errors(FALSE);
 
-
                 if (xicon) {
                     if (w > 0 && h > 0) {
                         /* is this icon in the cache yet? */
@@ -2623,7 +2619,6 @@ gboolean client_enter_focusable(ObClient *self)
             self->type != OB_CLIENT_TYPE_DESKTOP);
 }
 
-
 static void client_apply_startup_state(ObClient *self,
                                        gint x, gint y, gint w, gint h)
 {
@@ -2933,7 +2928,6 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
     g_assert(*h > 0);
 }
 
-
 void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
                       gboolean user, gboolean final, gboolean force_reply)
 {
index 8a01ee1ff4345121066695d2c59ae17cf5536aae..cc5fa89af75d0902878aee76352509a83efb1b62 100644 (file)
@@ -197,5 +197,4 @@ ObAppSettings* config_create_app_settings(void);
 void config_app_settings_copy_non_defaults(const ObAppSettings *src,
                                            ObAppSettings *dest);
 
-
 #endif
index a0ce223a231eaa5a14b4170e54d2c27f948f2ef7..aca69cc36aab7380ea9dcee15611f6e63e8c12d3 100644 (file)
@@ -1125,7 +1125,6 @@ static void event_handle_client(ObClient *client, XEvent *e)
                 move = TRUE;
             }
 
-
         if (e->xconfigurerequest.value_mask & CWStackMode) {
             ObClient *sibling = NULL;
             gulong ignore_start;
index 23cf910148d711cdf89d4c4e4c08af8b2bfca7e3..baf88e8134bcc8227c8706cdbae849184781da7e 100644 (file)
@@ -364,4 +364,3 @@ gboolean focus_valid_target(ObClient *ft,
 
     return ok;
 }
-
index 4d79377735928a6c9f1976860939c44975d3766a..063de6447bfa3b5f44d9483a752e1ac768764888 100644 (file)
@@ -95,7 +95,6 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
         list = client_list;
     }
 
-
     if (focus_cycle_target == NULL) {
         focus_cycle_iconic_windows = TRUE;
         focus_cycle_all_desktops = all_desktops;
index 25c470489596c8b12a42d3e3d91cfd9c9c0b87df..8a7b1aef441f6206624d2af5893169fb80013a71 100644 (file)
@@ -1133,15 +1133,37 @@ static gboolean is_button_present(ObFrame *self, const gchar *lc, gint dir) {
     return FALSE;
 }
 
+static void place_button(ObFrame *self, const char *lc, gint bwidth,
+                         gint left, gint i,
+                         gint *x, gint *button_on, gint *button_x)
+{
+  if (!(*button_on = is_button_present(self, lc, i)))
+    return;
+
+  self->label_width -= bwidth;
+  if (i > 0)
+    *button_x = *x;
+  *x += i * bwidth;
+  if (i < 0) {
+    if (self->label_x <= left || *x > self->label_x) {
+      *button_x = *x;
+    } else {
+      /* the button would have been drawn on top of another button */
+      *button_on = FALSE;
+      self->label_width += bwidth;
+    }
+  }
+}
+
 static void layout_title(ObFrame *self)
 {
     gchar *lc;
     gint i;
 
     const gint bwidth = ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;
-    /* position of the left most button */
+    /* position of the leftmost button */
     const gint left = ob_rr_theme->paddingx + 1;
-    /* position of the right most button */
+    /* position of the rightmost button */
     const gint right = self->width;
 
     /* turn them all off */
@@ -1180,53 +1202,23 @@ static void layout_title(ObFrame *self)
                 break; /* break the for loop, do other side of label */
             } else if (*lc == 'N') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICON;
-                if ((self->icon_on = is_button_present(self, lc, i))) {
-                    /* icon is bigger than buttons */
-                    self->label_width -= bwidth + 2;
-                    if (i > 0) self->icon_x = x;
-                    x += i * (bwidth + 2);
-                    if (i < 0) self->icon_x = x;
-                }
+                /* icon is bigger than buttons */
+                place_button(self, lc, bwidth + 2, left, i, &x, &self->icon_on, &self->icon_x);
             } else if (*lc == 'D') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ALLDESKTOPS;
-                if ((self->desk_on = is_button_present(self, lc, i))) {
-                    self->label_width -= bwidth;
-                    if (i > 0) self->desk_x = x;
-                    x += i * bwidth;
-                    if (i < 0) self->desk_x = x;
-                }
+                place_button(self, lc, bwidth, left, i, &x, &self->desk_on, &self->desk_x);
             } else if (*lc == 'S') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_SHADE;
-                if ((self->shade_on = is_button_present(self, lc, i))) {
-                    self->label_width -= bwidth;
-                    if (i > 0) self->shade_x = x;
-                    x += i * bwidth;
-                    if (i < 0) self->shade_x = x;
-                }
+                place_button(self, lc, bwidth, left, i, &x, &self->shade_on, &self->shade_x);
             } else if (*lc == 'I') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICONIFY;
-                if ((self->iconify_on = is_button_present(self, lc, i))) {
-                    self->label_width -= bwidth;
-                    if (i > 0) self->iconify_x = x;
-                    x += i * bwidth;
-                    if (i < 0) self->iconify_x = x;
-                }
+                place_button(self, lc, bwidth, left, i, &x, &self->iconify_on, &self->iconify_x);
             } else if (*lc == 'M') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_MAXIMIZE;
-                if ((self->max_on = is_button_present(self, lc, i))) {
-                    self->label_width -= bwidth;
-                    if (i > 0) self->max_x = x;
-                    x += i * bwidth;
-                    if (i < 0) self->max_x = x;
-                }
+                place_button(self, lc, bwidth, left, i, &x, &self->max_on, &self->max_x);
             } else if (*lc == 'C') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_CLOSE;
-                if ((self->close_on = is_button_present(self, lc, i))) {
-                    self->label_width -= bwidth;
-                    if (i > 0) self->close_x = x;
-                    x += i * bwidth;
-                    if (i < 0) self->close_x = x;
-                }
+                place_button(self, lc, bwidth, left, i, &x, &self->close_on, &self->close_x);
             } else
                 continue; /* don't set firstcon */
             firstcon = NULL;
@@ -1276,8 +1268,7 @@ static void layout_title(ObFrame *self)
     } else
         XUnmapWindow(obt_display, self->close);
 
-    if (self->label_on) {
-        self->label_width = MAX(1, self->label_width); /* no lower than 1 */
+    if (self->label_on && self->label_width > 0) {
         XMapWindow(obt_display, self->label);
         XMoveWindow(obt_display, self->label, self->label_x,
                     ob_rr_theme->paddingy);
index 5ac423639c35628036133ece70dc9279ac94770a..a693a71c3d63ca3ea287aec1ce440f16b125c61f 100644 (file)
@@ -324,4 +324,3 @@ void keyboard_shutdown(gboolean reconfig)
     popup_free(popup);
     popup = NULL;
 }
-
index 391cb154fb91a5cc61c2f12ac8771dd8a17b91b3..66edc3c7faf0af58ba57827370debed953d6c74d 100644 (file)
@@ -42,5 +42,4 @@ void tree_assimilate(KeyBindingTree *node);
 KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict);
 gboolean tree_chroot(KeyBindingTree *tree, GList *keylist);
 
-
 #endif
index 432aa2be9d5b849a6e309f8b402fddba44b8deeb..f7d50e39f0f59f8e05b7c1b1e805827beb2bab33 100644 (file)
@@ -58,7 +58,6 @@ static gunichar parse_shortcut(const gchar *label, gboolean allow_shortcut,
                                gchar **strippedlabel, guint *position,
                                gboolean *always_show);
 
-
 static void client_dest(ObClient *client, gpointer data)
 {
     /* menus can be associated with a client, so close any that are since
index 7b4c872b475b5b30f1ed0964d0758f3bbc70ee92..1e767e965f45cdbdc92830b7190aa6319376ece0 100644 (file)
@@ -701,7 +701,6 @@ void menu_frame_render(ObMenuFrame *self)
         XSetWindowBorder(obt_display, e->window,
                          RrColorPixel(ob_rr_theme->menu_border_color));
 
-
         text_a = (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
                   !e->entry->data.normal.enabled ?
                   /* disabled */
@@ -1091,7 +1090,6 @@ void menu_frame_hide_all_client(ObClient *client)
     }
 }
 
-
 ObMenuFrame* menu_frame_under(gint x, gint y)
 {
     ObMenuFrame *ret = NULL;
index ddc518adbb299d905ffc0f3bde9c12808362e761..f501996bca7dd9df24c6ebe6e3f9160d785dab03 100644 (file)
@@ -352,7 +352,6 @@ static void do_move(gboolean keyboard, gint keydist)
                      moveresize_client->frame->area.y);
 }
 
-
 static void do_resize(void)
 {
     gint x, y, w, h, lw, lh;
index 31d805ae2a6000ff133a8c9b9ddb4792a6de4e3f..52223f1949911e477a9449502be81e13b8cbb86a 100644 (file)
@@ -292,7 +292,6 @@ static void prompt_layout(ObPrompt *self)
         self->button[i].width = MAX(self->button[i].width, bw);
         self->button[i].height = MAX(self->button[i].height, bh);
 
-
         self->button[i].width += BUTTON_HMARGIN * 2;
         self->button[i].height += BUTTON_VMARGIN * 2;
 
index ea909897f3a41adec17d8cf6a7114cbdb64d9344..e4ecb6c7615c0c9057422c0bd8bb74fb1d1b2cdd 100644 (file)
@@ -401,7 +401,6 @@ static void sm_save_yourself_2(SmcConn conn, SmPointer data)
     SmcSaveYourselfDone(conn, success);
 }
 
-
 static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type,
                              Bool shutdown, gint interact_style, Bool fast)
 {
index fc75047f3a570b3f266025fb1c30206893bac1bc..2f9bfd279236b0733993773e0e9d0e9e582cc3af 100644 (file)
@@ -659,7 +659,6 @@ static void gradient_vertical(RrSurface *sf, gint w, gint h)
     }
 }
 
-
 static void gradient_diagonal(RrSurface *sf, gint w, gint h)
 {
     gint x, y;
index fd442d26b40bc43b83e074fa120cc1060437ca55..7c00c1462509496fde0b99969748605889f0c04d 100644 (file)
@@ -333,7 +333,6 @@ void RrAppearanceFree(RrAppearance *a)
     }
 }
 
-
 static void pixel_data_to_pixmap(RrAppearance *l,
                                  gint x, gint y, gint w, gint h)
 {
index 36c962daf657567def152d81431655052c100652..55ab621eac39954f92d637a5cc743b9edf806071 100644 (file)
@@ -90,7 +90,6 @@ gint main()
     exit (0);
 #endif
 
-
     RrPaint(look, win, w, h);
     done = 0;
     while (!done) {
index ece4037c3e8c50acf26b82d71b529f72956168ad..47c8a9c9cbfb77b4add7862268b868d96e199bc3 100644 (file)
@@ -577,7 +577,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
     theme->def_win_icon_w = OB_DEFAULT_ICON_WIDTH;
     theme->def_win_icon_h = OB_DEFAULT_ICON_HEIGHT;
 
-
     /* read the decoration textures */
     if (!read_appearance(db, inst,
                          "window.active.title.bg", theme->a_focused_title,
@@ -1780,7 +1779,6 @@ static void parse_appearance(gchar *tex, RrSurfaceColorType *grad,
         *interlaced = FALSE;
 }
 
-
 static gboolean read_appearance(XrmDatabase db, const RrInstance *inst,
                                 const gchar *rname, RrAppearance *value,
                                 gboolean allow_trans)
index 7ef934f249b0745b1b44b8c9ac507dfebbb54542..7a2aa97385a216201bf1101c888384096ee2d155 100644 (file)
@@ -66,7 +66,6 @@ int main () {
                   PropModeReplace, (unsigned char*)&num, 1);
   XFlush(display);
 
-
   while (1) {
     XNextEvent(display, &report);
   }
This page took 0.041169 seconds and 4 git commands to generate.