Merge branch 'backport' into work
authorMikael Magnusson <mikachu@comhem.se>
Sat, 8 Mar 2008 15:51:19 +0000 (16:51 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Sat, 8 Mar 2008 15:52:06 +0000 (16:52 +0100)
Conflicts:

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

20 files changed:
1  2 
obt/util.h
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/menu.c
openbox/menuframe.c
openbox/moveresize.c
openbox/prompt.c
openbox/resist.c
openbox/session.c
render/image.c
render/theme.c

diff --cc obt/util.h
index ff44d36431f3226fc9043419b4ea21d154fc3959,0000000000000000000000000000000000000000..4e03b9d9214679c4f7fb0a3000bd82a5904eba6c
mode 100644,000000..100644
--- /dev/null
@@@ -1,37 -1,0 +1,36 @@@
 +/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
 +
 +   obt/util.h for the Openbox window manager
 +   Copyright (c) 2007        Dana Jansens
 +
 +   This program is free software; you can redistribute it and/or modify
 +   it under the terms of the GNU General Public License as published by
 +   the Free Software Foundation; either version 2 of the License, or
 +   (at your option) any later version.
 +
 +   This program is distributed in the hope that it will be useful,
 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +   GNU General Public License for more details.
 +
 +   See the COPYING file for a copy of the GNU General Public License.
 +*/
 +
 +#ifndef __obt_util_h
 +#define __obt_util_h
 +
 +#include <glib.h>
 +
 +#ifdef HAVE_STRING_H
 +#  include <string.h> /* for memset() */
 +#endif
 +
 +G_BEGIN_DECLS
 +
 +/* Util funcs */
 +#define obt_free g_free
 +#define obt_free0(p, type, num) memset((p), 0, sizeof(type) * (num)), g_free(p)
 +
 +G_END_DECLS
 +
 +#endif /*__obt_util_h*/
Simple merge
index 44d87cf6cf4a3fff0d3c0e34f6547b263030d375,6fba17ffb1f3113ffd0b8d26a936cb91ff2f57d0..5354f087c55254f5fdd5fd700a63e88a93ac6cc7
@@@ -47,36 -49,32 +47,36 @@@ static gpointer setup_func(xmlNodePtr n
      Options *o;
  
      o = g_new0(Options, 1);
 -    o->dialog = TRUE;
      o->bar = TRUE;
 -
 -    if ((n = parse_find_node("linear", node)))
 -        o->linear = parse_bool(doc, n);
 -    if ((n = parse_find_node("dialog", node)))
 -        o->dialog = parse_bool(doc, n);
 -    if ((n = parse_find_node("bar", node)))
 -        o->bar = parse_bool(doc, n);
 -    if ((n = parse_find_node("raise", node)))
 -        o->raise = parse_bool(doc, n);
 -    if ((n = parse_find_node("panels", node)))
 -        o->dock_windows = parse_bool(doc, n);
 -    if ((n = parse_find_node("desktop", node)))
 -        o->desktop_windows = parse_bool(doc, n);
 -    if ((n = parse_find_node("allDesktops", node)))
 -        o->all_desktops = parse_bool(doc, n);
 -
 -    if ((n = parse_find_node("finalactions", node))) {
 +    o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_LIST;
 +
 +    if ((n = obt_parse_find_node(node, "linear")))
 +        o->linear = obt_parse_node_bool(n);
 +    if ((n = obt_parse_find_node(node, "dialog"))) {
 +        if (obt_parse_node_contains(n, "none"))
 +            o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_NONE;
 +        else if (obt_parse_node_contains(n, "icons"))
 +            o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_ICONS;
 +    }
 +    if ((n = obt_parse_find_node(node, "bar")))
 +        o->bar = obt_parse_node_bool(n);
 +    if ((n = obt_parse_find_node(node, "raise")))
 +        o->raise = obt_parse_node_bool(n);
 +    if ((n = obt_parse_find_node(node, "panels")))
 +        o->dock_windows = obt_parse_node_bool(n);
 +    if ((n = obt_parse_find_node(node, "desktop")))
 +        o->desktop_windows = obt_parse_node_bool(n);
 +    if ((n = obt_parse_find_node(node, "allDesktops")))
 +        o->all_desktops = obt_parse_node_bool(n);
 +
 +    if ((n = obt_parse_find_node(node, "finalactions"))) {
          xmlNodePtr m;
  
 -        m = parse_find_node("action", n->xmlChildrenNode);
 +        m = obt_parse_find_node(n->children, "action");
          while (m) {
 -            ObActionsAct *action = actions_parse(i, doc, 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 = parse_find_node("action", m->next);
 +            m = obt_parse_find_node(m->next, "action");
          }
      }
      else {
Simple merge
index c5c25c11329b0aa7768df61a60f0c55597069fab,d9f24d61e53736d4731e9efffd201c76bda39377..d3633d507356aff655be907e9414c3772e16954c
@@@ -85,14 -87,14 +85,14 @@@ static gpointer setup_func(xmlNodePtr n
          g_free(s);
      }
  
 -    if ((n = parse_find_node("finalactions", node))) {
 +    if ((n = obt_parse_find_node(node, "finalactions"))) {
          xmlNodePtr m;
  
 -        m = parse_find_node("action", n->xmlChildrenNode);
 +        m = obt_parse_find_node(n->children, "action");
          while (m) {
 -            ObActionsAct *action = actions_parse(i, doc, 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 = parse_find_node("action", m->next);
 +            m = obt_parse_find_node(m->next, "action");
          }
      }
      else {
index e9443d4914e256ac5647e7ef2dafd261c7ca13b8,2c12b86c2cc9be350790b858e2de57e3858aae86..d1bdd163925f512708cab304068154bbf1374cda
@@@ -567,13 -645,12 +565,12 @@@ void client_manage(Window window, ObPro
      /* free the ObAppSettings shallow copy */
      g_free(settings);
  
 -    ob_debug("Managed window 0x%lx plate 0x%x (%s)\n",
 +    ob_debug("Managed window 0x%lx plate 0x%x (%s)",
               window, self->frame->window, self->class);
  
 -    return;
 +    hooks_queue(OB_HOOK_WIN_NEW, self);
  }
  
  ObClient *client_fake_manage(Window window)
  {
      ObClient *self;
@@@ -2114,9 -2183,8 +2110,8 @@@ void client_update_icons(ObClient *self
                                         (hints->flags & IconMaskHint ?
                                          hints->icon_mask : None),
                                         (gint*)&w, (gint*)&h, &data);
 -                xerror_set_ignore(FALSE);
 +                obt_display_ignore_errors(FALSE);
  
                  if (xicon) {
                      if (w > 0 && h > 0) {
                          /* is this icon in the cache yet? */
Simple merge
diff --cc openbox/event.c
Simple merge
diff --cc openbox/focus.c
Simple merge
Simple merge
diff --cc openbox/frame.c
index 25c470489596c8b12a42d3e3d91cfd9c9c0b87df,235dd30b03726856db1b42337b46ad2b2bf988df..58d9f355b1dfdf9612082fff3b7b774a3d4ff32b
@@@ -588,9 -590,8 +588,8 @@@ void frame_adjust_area(ObFrame *self, g
                                                   sidebwidth) * 2,
                                    self->bwidth);
  
                  if (sidebwidth) {
 -                    XMoveResizeWindow(ob_display, self->lgripleft,
 +                    XMoveResizeWindow(obt_display, self->lgripleft,
                                        0,
                                        self->size.top +
                                        self->client->area.height +
@@@ -1235,54 -1230,53 +1226,53 @@@ static void layout_title(ObFrame *self
  
      /* position and map the elements */
      if (self->icon_on) {
 -        XMapWindow(ob_display, self->icon);
 -        XMoveWindow(ob_display, self->icon, self->icon_x,
 +        XMapWindow(obt_display, self->icon);
 +        XMoveWindow(obt_display, self->icon, self->icon_x,
                      ob_rr_theme->paddingy);
      } else
 -        XUnmapWindow(ob_display, self->icon);
 +        XUnmapWindow(obt_display, self->icon);
  
      if (self->desk_on) {
 -        XMapWindow(ob_display, self->desk);
 -        XMoveWindow(ob_display, self->desk, self->desk_x,
 +        XMapWindow(obt_display, self->desk);
 +        XMoveWindow(obt_display, self->desk, self->desk_x,
                      ob_rr_theme->paddingy + 1);
      } else
 -        XUnmapWindow(ob_display, self->desk);
 +        XUnmapWindow(obt_display, self->desk);
  
      if (self->shade_on) {
 -        XMapWindow(ob_display, self->shade);
 -        XMoveWindow(ob_display, self->shade, self->shade_x,
 +        XMapWindow(obt_display, self->shade);
 +        XMoveWindow(obt_display, self->shade, self->shade_x,
                      ob_rr_theme->paddingy + 1);
      } else
 -        XUnmapWindow(ob_display, self->shade);
 +        XUnmapWindow(obt_display, self->shade);
  
      if (self->iconify_on) {
 -        XMapWindow(ob_display, self->iconify);
 -        XMoveWindow(ob_display, self->iconify, self->iconify_x,
 +        XMapWindow(obt_display, self->iconify);
 +        XMoveWindow(obt_display, self->iconify, self->iconify_x,
                      ob_rr_theme->paddingy + 1);
      } else
 -        XUnmapWindow(ob_display, self->iconify);
 +        XUnmapWindow(obt_display, self->iconify);
  
      if (self->max_on) {
 -        XMapWindow(ob_display, self->max);
 -        XMoveWindow(ob_display, self->max, self->max_x,
 +        XMapWindow(obt_display, self->max);
 +        XMoveWindow(obt_display, self->max, self->max_x,
                      ob_rr_theme->paddingy + 1);
      } else
 -        XUnmapWindow(ob_display, self->max);
 +        XUnmapWindow(obt_display, self->max);
  
      if (self->close_on) {
 -        XMapWindow(ob_display, self->close);
 -        XMoveWindow(ob_display, self->close, self->close_x,
 +        XMapWindow(obt_display, self->close);
 +        XMoveWindow(obt_display, self->close, self->close_x,
                      ob_rr_theme->paddingy + 1);
      } else
 -        XUnmapWindow(ob_display, self->close);
 +        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(ob_display, self->label);
 -        XMoveWindow(ob_display, self->label, self->label_x,
 +        XMapWindow(obt_display, self->label);
 +        XMoveWindow(obt_display, self->label, self->label_x,
                      ob_rr_theme->paddingy);
      } else
 -        XUnmapWindow(ob_display, self->label);
 +        XUnmapWindow(obt_display, self->label);
  }
  
  ObFrameContext frame_context_from_string(const gchar *name)
Simple merge
diff --cc openbox/menu.c
Simple merge
index 7b4c872b475b5b30f1ed0964d0758f3bbc70ee92,a9b544081fb110a88f9da17ce17c6ada88c2640f..1e767e965f45cdbdc92830b7190aa6319376ece0
@@@ -695,13 -690,12 +695,12 @@@ void menu_frame_render(ObMenuFrame *sel
          }
  
          RECT_SET_POINT(e->area, 0, h+e->border);
 -        XMoveWindow(ob_display, e->window,
 +        XMoveWindow(obt_display, e->window,
                      e->area.x-e->border, e->area.y-e->border);
 -        XSetWindowBorderWidth(ob_display, e->window, e->border);
 -        XSetWindowBorder(ob_display, e->window,
 +        XSetWindowBorderWidth(obt_display, e->window, e->border);
 +        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 */
Simple merge
Simple merge
index 3bcb95ffc4db5779f870d29b47f7fdb6fbd9f129,f21eb8e682e3c8eb63c7453f4ec41c472e9f4d36..f954429bdc3ccaeacb0fce0dd9941601a57c96e0
@@@ -108,7 -109,7 +108,6 @@@ void resist_move_windows(ObClient *c, g
  
      frame_client_gravity(c->frame, x, y);
  
--
      for (it = stacking_list; it; it = g_list_next(it)) {
          ObClient *target;
  
Simple merge
diff --cc render/image.c
Simple merge
diff --cc render/theme.c
Simple merge