Add mikabox on mikabox branch this time, yay!
authorMikael Magnusson <mikachu@comhem.se>
Fri, 20 Jul 2007 20:13:43 +0000 (22:13 +0200)
committerMikael Magnusson <mikachu@comhem.se>
Mon, 23 Jul 2007 00:02:30 +0000 (02:02 +0200)
Signed-off-by: Mikael Magnusson <mikachu@comhem.se>
39 files changed:
Makefile.am
m4/openbox.m4
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/iconify.c
openbox/actions/toggledebug.c [new file with mode: 0644]
openbox/client.c
openbox/client.h
openbox/client_list_combined_menu.c
openbox/client_list_menu.c
openbox/client_menu.c
openbox/config.c
openbox/config.h
openbox/debug.c
openbox/dock.c
openbox/event.c
openbox/extensions.c
openbox/focus_cycle_indicator.c
openbox/keyboard.c
openbox/keyboard.h
openbox/keytree.c
openbox/keytree.h
openbox/menuframe.c
openbox/openbox.c
openbox/place.c
openbox/place.h
openbox/popup.c
openbox/prop.c
openbox/prop.h
openbox/resist.c
openbox/screen.c
openbox/translate.c
render/font.c
render/test.c
render/theme.c
render/theme.h
tests/icons.c
tests/showhide.c
tests/urgent.c

index dd6d68354a65251f12af08635c9f9a45ca48eda2..29c65e6376a2aac435c3682bef41cdb15c8c0f68 100644 (file)
@@ -145,6 +145,8 @@ openbox_openbox_LDADD = \
        $(LIBINTL) \
        render/libobrender.la \
        parser/libobparser.la
+#      $(XFT_LIBS) \
+#      $(PANGO_LIBS) \
 openbox_openbox_LDFLAGS = -export-dynamic
 openbox_openbox_SOURCES = \
        gettext.h \
@@ -185,6 +187,7 @@ openbox_openbox_SOURCES = \
        openbox/actions/shade.c \
        openbox/actions/showdesktop.c \
        openbox/actions/showmenu.c \
+       openbox/actions/toggledebug.c \
        openbox/actions/unfocus.c \
        openbox/actions.c \
        openbox/actions.h \
index 29114360f3608e2433bf16797a9b054a302e497f..40281f417d425e3e384527af3dbe1a5fde449404 100644 (file)
@@ -2,7 +2,6 @@
 #
 # Check if the user has requested a debug build.
 # Sets the DEBUG or NDEBUG variables as appropriate
-# Sets the CVS environment variable when building CVS sources.
 AC_DEFUN([OB_DEBUG],
 [
     AC_MSG_CHECKING([build type])
index 06858c05e693c4602581f8f1a368b53fd21e2190..db37840bded1c862e8879ee7b759b076ba8cefc1 100644 (file)
@@ -38,4 +38,5 @@ void action_all_startup()
     action_growtoedge_startup();
     action_if_startup();
     action_focustobottom_startup();
+    action_toggledebug_startup();
 }
index 5f3f573f247a967e3c1e19f3b5c85b29a8584b7b..95b69e1fe73a2130e424046e3b904bd6303542c7 100644 (file)
@@ -39,5 +39,6 @@ void action_movetoedge_startup();
 void action_growtoedge_startup();
 void action_if_startup();
 void action_focustobottom_startup();
+void action_toggledebug_startup();
 
 #endif
index b82684ea1babbd9e5f8e7654a45f74594c34008c..1ef2da398a883b75dffd1510d878dbedbe6dc032 100644 (file)
@@ -2,21 +2,31 @@
 #include "openbox/client.h"
 
 static gboolean run_func(ObActionsData *data, gpointer options);
+static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
 
 void action_iconify_startup()
 {
     actions_register("Iconify",
-                     NULL, NULL,
+                     setup_func,
+                     NULL,
                      run_func,
                      NULL, NULL);
 }
 
+static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
+{
+    xmlNodePtr n;
+
+    if ((n = parse_find_node("de", node)))
+        return parse_bool(doc, n);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
     if (data->client) {
         actions_client_move(data, TRUE);
-        client_iconify(data->client, TRUE, TRUE, FALSE);
+        client_iconify(data->client, !options, TRUE, FALSE);
         actions_client_move(data, FALSE);
     }
 
diff --git a/openbox/actions/toggledebug.c b/openbox/actions/toggledebug.c
new file mode 100644 (file)
index 0000000..82c3c54
--- /dev/null
@@ -0,0 +1,22 @@
+#include "openbox/actions.h"
+#include "openbox/stacking.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+extern gboolean debug_show;
+
+void action_toggledebug_startup()
+{
+    actions_register("toggledebug",
+                     NULL, NULL,
+                     run_func,
+                     NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+    ob_debug_show_output(!debug_show);
+    g_message("Debug output turned %s", debug_show ? "on" : "off");
+
+    return FALSE;
+}
index a7b616d22eb2f5fd7db0ff62497db7d4a9dfb363..2aa0f0e7925f439b522b531079fbab97152e019f 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <glib.h>
 #include <X11/Xutil.h>
+#include <unistd.h>
 
 /*! The event mask to grab on client windows */
 #define CLIENT_EVENTMASK (PropertyChangeMask | StructureNotifyMask | \
@@ -64,6 +65,8 @@ typedef struct
 
 GList            *client_list          = NULL;
 
+extern ObDock *dock;
+
 static GSList *client_destroy_notifies = NULL;
 
 static void client_get_all(ObClient *self, gboolean real);
@@ -73,7 +76,6 @@ static void client_get_area(ObClient *self);
 static void client_get_desktop(ObClient *self);
 static void client_get_state(ObClient *self);
 static void client_get_shaped(ObClient *self);
-static void client_get_mwm_hints(ObClient *self);
 static void client_get_colormap(ObClient *self);
 static void client_change_allowed_actions(ObClient *self);
 static void client_change_state(ObClient *self);
@@ -1384,7 +1386,7 @@ static void client_update_transient_tree(ObClient *self,
     }
 }
 
-static void client_get_mwm_hints(ObClient *self)
+void client_get_mwm_hints(ObClient *self)
 {
     guint num;
     guint32 *hints;
@@ -2082,14 +2084,18 @@ void client_update_icons(ObClient *self)
     if (self->nicons == 0 && !self->parents) {
         RrPixel32 *icon = ob_rr_theme->def_win_icon;
         gulong *data;
+        gint32 r,g,b;
+        r = g_random_int_range(0,255);
+        g = g_random_int_range(0,255);
+        b = g_random_int_range(0,255);
 
         data = g_new(gulong, 48*48+2);
         data[0] = data[1] =  48;
         for (i = 0; i < 48*48; ++i)
             data[i+2] = (((icon[i] >> RrDefaultAlphaOffset) & 0xff) << 24) +
-                (((icon[i] >> RrDefaultRedOffset) & 0xff) << 16) +
-                (((icon[i] >> RrDefaultGreenOffset) & 0xff) << 8) +
-                (((icon[i] >> RrDefaultBlueOffset) & 0xff) << 0);
+                ((((icon[i] >> RrDefaultRedOffset) & 0xff)*r/255) << 16) +
+                ((((icon[i] >> RrDefaultGreenOffset) & 0xff)*g/255) << 8) +
+                ((((icon[i] >> RrDefaultBlueOffset) & 0xff)*b/255) << 0);
         PROP_SETA32(self->window, net_wm_icon, cardinal, data, 48*48+2);
         g_free(data);
     } else if (self->frame)
@@ -3109,6 +3115,10 @@ void client_iconify(ObClient *self, gboolean iconic, gboolean curdesk,
     }
 }
 
+/* dir: 0 = both
+ *      1 = horizontal
+ *      2 = vertical
+ */
 void client_maximize(ObClient *self, gboolean max, gint dir)
 {
     gint x, y, w, h;
@@ -3545,6 +3555,13 @@ gboolean client_can_focus(ObClient *self)
 
 gboolean client_focus(ObClient *self)
 {
+    {
+        XkbStateRec state;
+        XkbGetState(ob_display, XkbUseCoreKbd, &state);
+        if (state.locked_mods & 128)
+            return FALSE;
+    }
+
     /* we might not focus this window, so if we have modal children which would
        be focused instead, bring them to this desktop */
     client_bring_modal_windows(self);
index cba1aebbd901ee4fb12ab15e5bf8aa818b86d80c..8e11699ecc34bc32047d65d07545e8a8f3f1545f 100644 (file)
@@ -621,6 +621,8 @@ void client_update_icon_geometry(ObClient *self);
 */
 void client_setup_decor_and_functions(ObClient *self, gboolean reconfig);
 
+/*! Retrieves the window's motif hints */
+void client_get_mwm_hints(ObClient *self);
 /*! Sets the window's type and transient flag */
 void client_get_type_and_transientness(ObClient *self);
 
index 556245df3981970e61471c1248478924d1680afa..c2fc0238fad6e7c1431aa0b9bf1b4e62ebc1ef6c 100644 (file)
@@ -48,6 +48,7 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
     for (desktop = 0; desktop < screen_num_desktops; desktop++) {
         gboolean empty = TRUE;
         gboolean onlyiconic = TRUE;
+        gboolean noicons = TRUE;
 
         menu_add_separator(menu, CLIENT, screen_desktop_names[desktop]);
         for (it = focus_order; it; it = g_list_next(it)) {
@@ -60,9 +61,11 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
                 empty = FALSE;
 
                 if (c->iconic) {
-                    gchar *title = g_strdup_printf("(%s)", c->icon_title);
-                    e = menu_add_normal(menu, CLIENT, title, NULL, FALSE);
-                    g_free(title);
+                    if (noicons) {
+                        menu_add_separator(menu, -1, NULL);
+                        noicons = FALSE;
+                    }
+                    e = menu_add_normal(menu, CLIENT, c->icon_title, NULL, FALSE);
                 } else {
                     onlyiconic = FALSE;
                     e = menu_add_normal(menu, CLIENT, c->title, NULL, FALSE);
@@ -143,7 +146,7 @@ void client_list_combined_menu_startup(gboolean reconfig)
     if (!reconfig)
         client_add_destroy_notify(client_dest, NULL);
 
-    combined_menu = menu_new(MENU_NAME, _("Windows"), TRUE, NULL);
+    combined_menu = menu_new(MENU_NAME, "ウィンドウ", TRUE, NULL);
     menu_set_update_func(combined_menu, self_update);
     menu_set_execute_func(combined_menu, menu_execute);
 }
index 25bb623054971d341b1bfc6b2145fc004b640978..3857d2ab16ae696f65368635e5ce8f0544ef1107 100644 (file)
@@ -48,6 +48,7 @@ static gboolean desk_menu_update(ObMenuFrame *frame, gpointer data)
     GList *it;
     gboolean empty = TRUE;
     gboolean onlyiconic = TRUE;
+    gboolean noicons = TRUE;
 
     menu_clear_entries(menu);
 
@@ -62,9 +63,11 @@ static gboolean desk_menu_update(ObMenuFrame *frame, gpointer data)
             empty = FALSE;
 
             if (c->iconic) {
-                gchar *title = g_strdup_printf("(%s)", c->icon_title);
-                e = menu_add_normal(menu, CLIENT, title, NULL, FALSE);
-                g_free(title);
+                if (noicons) {
+                    menu_add_separator(menu, -1, NULL);
+                    noicons = FALSE;
+                }
+                e = menu_add_normal(menu, CLIENT, c->icon_title, NULL, FALSE);
             } else {
                 onlyiconic = FALSE;
                 e = menu_add_normal(menu, CLIENT, c->title, NULL, FALSE);
@@ -171,9 +174,6 @@ static void self_execute(ObMenuEntry *self, ObMenuFrame *f,
 
 static void client_dest(ObClient *client, gpointer data)
 {
-    /* This concise function removes all references to a closed
-     * client in the client_list_menu, so we don't have to check
-     * in client.c */
     GSList *it;
     for (it = desktop_menus; it; it = g_slist_next(it)) {
         ObMenu *mit = it->data;
@@ -196,7 +196,7 @@ void client_list_menu_startup(gboolean reconfig)
     if (!reconfig)
         client_add_destroy_notify(client_dest, NULL);
 
-    menu = menu_new(MENU_NAME, _("Desktops"), TRUE, NULL);
+    menu = menu_new(MENU_NAME, "作業領域", FALSE, NULL);
     menu_set_update_func(menu, self_update);
     menu_set_execute_func(menu, self_execute);
 }
index 43f98c74cdf75758b2aa080df583b07d957c4df6..314e89b72b37318525e1d135cc480802bb02af0e 100644 (file)
@@ -415,6 +415,8 @@ void client_menu_startup()
 
     menu_add_submenu(menu, CLIENT_LAYER, LAYER_MENU_NAME);
 
+    menu_add_separator(menu, -1, NULL);
+    menu_add_submenu(menu, 0, "client-list-menu");
     menu_add_separator(menu, -1, NULL);
 
     e = menu_add_normal(menu, CLIENT_CLOSE, _("_Close"), NULL, TRUE);
index 0d6efc9250e5d83ef790b94accd2a38c5988906b..2cdf1fb2557566614412c51458c0c2c85cbb7eb3 100644 (file)
@@ -57,6 +57,7 @@ RrFont *config_font_osd;
 gint    config_desktops_num;
 GSList *config_desktops_names;
 guint   config_screen_firstdesk;
+gint    config_emulate_xinerama;
 
 gboolean config_resize_redraw;
 gboolean config_resize_four_corners;
@@ -93,6 +94,8 @@ GSList *config_menu_files;
 gint     config_resist_win;
 gint     config_resist_edge;
 
+gboolean config_stacking_dialogbringparent;
+
 GSList *config_per_app_settings;
 
 ObAppSettings* config_create_app_settings()
@@ -345,11 +348,13 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
     gchar *key;
     xmlNodePtr n;
     gboolean is_chroot = FALSE;
+    gboolean grab = TRUE;
 
     if (!parse_attr_string("key", node, &key))
         return;
 
     parse_attr_bool("chroot", node, &is_chroot);
+    parse_attr_bool("grab", node, &grab);
 
     keylist = g_list_append(keylist, key);
 
@@ -365,7 +370,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 
             action = actions_parse(i, doc, n);
             if (action)
-                keyboard_bind(keylist, action);
+                keyboard_bind(keylist, action, grab);
             n = parse_find_node("action", n->next);
         }
     }
@@ -483,6 +488,8 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
         config_focus_raise = parse_bool(doc, n);
     if ((n = parse_find_node("focusLast", node)))
         config_focus_last = parse_bool(doc, n);
+    if ((n = parse_find_node("dialogParentRaise", node)))
+        config_stacking_dialogbringparent = parse_bool(doc, n);
     if ((n = parse_find_node("underMouse", node)))
         config_focus_under_mouse = parse_bool(doc, n);
 }
@@ -494,9 +501,12 @@ static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 
     node = node->children;
 
-    if ((n = parse_find_node("policy", node)))
+    if ((n = parse_find_node("policy", node))) {
         if (parse_contains("UnderMouse", doc, n))
             config_place_policy = OB_PLACE_POLICY_MOUSE;
+        if (parse_contains("Random", doc, n))
+            config_place_policy = OB_PLACE_POLICY_RANDOM;
+    }
     if ((n = parse_find_node("center", node)))
         config_place_center = parse_bool(doc, n);
 }
@@ -618,6 +628,8 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
         if (d > 0)
             config_screen_firstdesk = (unsigned) d;
     }
+    if ((n = parse_find_node("emulatexinerama", node)))
+        config_emulate_xinerama = parse_bool(doc, n);
     if ((n = parse_find_node("names", node))) {
         GSList *it;
         xmlNodePtr nname;
@@ -872,6 +884,7 @@ void config_startup(ObParseInst *i)
     config_focus_raise = FALSE;
     config_focus_last = TRUE;
     config_focus_under_mouse = FALSE;
+    config_stacking_dialogbringparent = TRUE;
 
     parse_register(i, "focus", parse_focus, NULL);
 
@@ -899,6 +912,7 @@ void config_startup(ObParseInst *i)
 
     config_desktops_num = 4;
     config_screen_firstdesk = 1;
+    config_emulate_xinerama = FALSE;
     config_desktops_names = NULL;
 
     parse_register(i, "desktops", parse_desktops, NULL);
index 42bf35346770964de08b3774ce3c75d36174ad2b..3ea6e7a4c0cea72ebbb289ecab4ed82652baea75 100644 (file)
@@ -125,6 +125,8 @@ extern gchar *config_theme;
 extern gboolean config_theme_keepborder;
 /*! Titlebar button layout */
 extern gchar *config_title_layout;
+/* Windows bring their parents along when raising */
+extern gboolean config_stacking_dialogbringparent;
 /*! Animate windows iconifying and restoring */
 extern gboolean config_animate_iconify;
 
@@ -143,6 +145,8 @@ extern RrFont *config_font_osd;
 extern gint config_desktops_num;
 /*! Desktop to start on, put 5 to start in the center of a 3x3 grid */
 extern guint config_screen_firstdesk;
+/*! Emulate xinerama by dividing screen in two halves, left and right. */
+extern gboolean config_emulate_xinerama;
 /*! Names for the desktops */
 extern GSList *config_desktops_names;
 
index 0fceba489d64e90c79178b041830d7e9b1c07f2f..faabc63cfda3a5c42b42286bcf8d6d78d977b210 100644 (file)
 #include <stdarg.h>
 #include <stdio.h>
 
-static gboolean show;
+gboolean debug_show;
 
 void ob_debug_show_output(gboolean enable)
 {
-    show = enable;
+    debug_show = enable;
 }
 
 void ob_debug(const gchar *a, ...)
 {
     va_list vl;
 
-    if (show) {
+    if (debug_show) {
         fprintf(stderr, "DEBUG: ");
         va_start(vl, a);
         vfprintf(stderr, a, vl);
@@ -56,7 +56,7 @@ void ob_debug_type(ObDebugType type, const gchar *a, ...)
 
     g_assert(type < OB_DEBUG_TYPE_NUM);
 
-    if (show && enabled_types[type]) {
+    if (debug_show && enabled_types[type]) {
         switch (type) {
         case OB_DEBUG_FOCUS:
             fprintf(stderr, "FOCUS: ");
index 990c8208406b7f2838051bb2ea01e8a4786fe663..518f067122f6fa526b0ddf326583a545325195e9 100644 (file)
@@ -31,7 +31,7 @@
                          EnterWindowMask | LeaveWindowMask)
 #define DOCKAPP_EVENT_MASK (StructureNotifyMask)
 
-static ObDock *dock;
+ObDock *dock;
 
 StrutPartial dock_strut;
 
index c119573e3b975ff65e399764f16a07e603f88425..e29623ca8400df886a224f2d1d826cd991ec0181 100644 (file)
@@ -743,7 +743,8 @@ void event_enter_client(ObClient *client)
 {
     g_assert(config_focus_follow);
 
-    if (client_enter_focusable(client) && client_can_focus(client)) {
+    if (!moveresize_in_progress /*XXX fix this or finishing a move???*/
+        && client_enter_focusable(client) && client_can_focus(client)) {
         if (config_focus_delay) {
             ObFocusDelayData *data;
 
@@ -1298,8 +1299,10 @@ static void event_handle_client(ObClient *client, XEvent *e)
                               "_NET_ACTIVE_WINDOW message for window %s is "
                               "missing source indication\n");
             client_activate(client, FALSE, TRUE, TRUE,
-                            (e->xclient.data.l[0] == 0 ||
+       /*stealing*/         /*1 || */(e->xclient.data.l[0] == 0 ||
                              e->xclient.data.l[0] == 2));
+        } else if (msgtype == prop_atoms.ob_focus) {
+            client_focus(client);
         } else if (msgtype == prop_atoms.net_wm_moveresize) {
             ob_debug("net_wm_moveresize for 0x%lx direction %d\n",
                      client->window, e->xclient.data.l[2]);
@@ -1431,6 +1434,15 @@ static void event_handle_client(ObClient *client, XEvent *e)
                                   "with invalid detail %d\n",
                                   client->title, e->xclient.data.l[2]);
             }
+/*
+        } else if (msgtype == prop_atoms.ob_client_menu) {
+            gint x = e->xclient.data.l[0];
+            gint y = e->xclient.data.l[1];
+            gint button = e->xclient.data.l[2];
+            ObAction *a = action_from_string("showmenu", OB_USER_ACTION_MOUSE_PRESS);
+            GSList *l = g_slist_append(NULL, a);
+            action_run_list(l, client, OB_FRAME_CONTEXT_NONE, 0, button, x, y, CurrentTime, 0, 0);
+//            menu_show("client-menu", x, y, button, client);*/
         }
         break;
     case PropertyNotify:
@@ -1520,12 +1532,28 @@ static void event_handle_client(ObClient *client, XEvent *e)
             client_update_sync_request_counter(client);
         }
 #endif
+        else if (msgtype == prop_atoms.motif_wm_hints) {
+            ob_debug("getting mwm hints!!!\n");
+            client_get_mwm_hints(client);
+            client_get_type_and_transientness(client);
+            client_calc_layer(client);
+            client_setup_decor_and_functions(client, TRUE);
+        }
         break;
     case ColormapNotify:
         client_update_colormap(client, e->xcolormap.colormap);
         break;
     default:
+#if 0
+        {
+        char *msgname = XGetAtomName(ob_display, msgtype);
+        ob_debug("got a property notify \"%s\" from client \"%s\" with title \"%s\"\n", msgname, client->name, client->title);
+        fflush(stdout);
+        XFree(msgname);
+        }
+#else
         ;
+#endif
 #ifdef SHAPE
         if (extensions_shape && e->type == extensions_shape_event_basep) {
             client->shaped = ((XShapeEvent*)e)->shaped;
@@ -1539,10 +1567,20 @@ static void event_handle_dock(ObDock *s, XEvent *e)
 {
     switch (e->type) {
     case ButtonPress:
-        if (e->xbutton.button == 1)
-            stacking_raise(DOCK_AS_WINDOW(s));
-        else if (e->xbutton.button == 2)
-            stacking_lower(DOCK_AS_WINDOW(s));
+        switch (e->xbutton.button) {
+            case 1:
+                stacking_raise(DOCK_AS_WINDOW(s));
+                break;
+            case 2:
+                stacking_lower(DOCK_AS_WINDOW(s));
+                break;
+            case 4:
+                screen_cycle_desktop(OB_DIRECTION_WEST, TRUE, TRUE, FALSE, TRUE, FALSE);
+                break;
+            case 5:
+                screen_cycle_desktop(OB_DIRECTION_EAST, TRUE, TRUE, FALSE, TRUE, FALSE);
+                break;
+        }
         break;
     case EnterNotify:
         dock_hide(FALSE);
index 89a965769970e8224d01029cf8c9a3f934b665cd..729ed289fb849a1ed70eda1a07c8331a86042bc5 100644 (file)
@@ -21,6 +21,7 @@
 #include "geom.h"
 #include "extensions.h"
 #include "screen.h"
+#include "config.h"
 #include "debug.h"
 
 gboolean extensions_xkb       = FALSE;
@@ -86,6 +87,7 @@ void extensions_xinerama_screens(Rect **xin_areas, guint *nxin)
 {
     guint i;
     gint l, r, t, b;
+    /*
 #ifdef XINERAMA
     if (extensions_xinerama) {
         guint i;
@@ -99,22 +101,27 @@ void extensions_xinerama_screens(Rect **xin_areas, guint *nxin)
         XFree(info);
     } else
 #endif
-    if (ob_debug_xinerama) {
-        gint w = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen));
-        gint h = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen));
-        *nxin = 2;
-        *xin_areas = g_new(Rect, *nxin + 1);
-        RECT_SET((*xin_areas)[0], 0, 0, w/2, h);
-        RECT_SET((*xin_areas)[1], w/2, 0, w-(w/2), h);
-    }
-    else {
+    */
+    if (config_emulate_xinerama) {
+    *nxin = 2;
+    *xin_areas = g_new(Rect, *nxin + 1);
+    RECT_SET((*xin_areas)[0], 0, 0,
+                 WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)) / 2,
+                 HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)));
+    RECT_SET((*xin_areas)[1],
+                 WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)) / 2,
+                 0,
+                 WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)) / 2,
+                 HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)));
+    RECT_SET((*xin_areas)[*nxin], 0, 0,
+                 WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)),
+                 HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)));
+    } else {
         *nxin = 1;
         *xin_areas = g_new(Rect, *nxin + 1);
         RECT_SET((*xin_areas)[0], 0, 0,
                  WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)),
                  HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)));
-    }
-
     /* returns one extra with the total area in it */
     l = (*xin_areas)[0].x;
     t = (*xin_areas)[0].y;
@@ -127,4 +134,5 @@ void extensions_xinerama_screens(Rect **xin_areas, guint *nxin)
         b = MAX(b, (*xin_areas)[i].y + (*xin_areas)[i].height - 1);
     }
     RECT_SET((*xin_areas)[*nxin], l, t, r - l + 1, b - t + 1);
+    }
 }
index 790713145d09a540e5c4f9a94b40e2593f06dd25..0318069b88fc6eca246c6f9898a7d6cbcc739e72 100644 (file)
@@ -80,13 +80,13 @@ void focus_cycle_indicator_startup(gboolean reconfig)
     stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.right));
     stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.bottom));
 
-    color_white = RrColorNew(ob_rr_inst, 0xff, 0xff, 0xff);
+    color_white = RrColorNew(ob_rr_inst, 0x00, 0x00, 0xff);
 
     a_focus_indicator = RrAppearanceNew(ob_rr_inst, 4);
     a_focus_indicator->surface.grad = RR_SURFACE_SOLID;
     a_focus_indicator->surface.relief = RR_RELIEF_FLAT;
     a_focus_indicator->surface.primary = RrColorNew(ob_rr_inst,
-                                                    0, 0, 0);
+                                                    0xA6, 0xCA, 0xF4);
     a_focus_indicator->texture[0].type = RR_TEXTURE_LINE_ART;
     a_focus_indicator->texture[0].data.lineart.color = color_white;
     a_focus_indicator->texture[1].type = RR_TEXTURE_LINE_ART;
index 6e45e5c49b6ddd624f4b46462bc1fc948729f310..bb4e4fce3c4653346c15d24ec9af31b471586316 100644 (file)
@@ -51,8 +51,9 @@ static void grab_keys(gboolean grab)
     if (grab) {
         p = curpos ? curpos->first_child : keyboard_firstnode;
         while (p) {
-            grab_key(p->key, p->state, RootWindow(ob_display, ob_screen),
-                     GrabModeAsync);
+            if (p->grab)
+                grab_key(p->key, p->state, RootWindow(ob_display, ob_screen),
+                         GrabModeAsync);
             p = p->next_sibling;
         }
         if (curpos)
@@ -127,14 +128,14 @@ void keyboard_chroot(GList *keylist)
        chroot binding. so add it to the tree then. */
     if (!tree_chroot(keyboard_firstnode, keylist)) {
         KeyBindingTree *tree;
-        if (!(tree = tree_build(keylist)))
+        if (!(tree = tree_build(keylist, TRUE)))
             return;
         tree_chroot(tree, keylist);
         tree_assimilate(tree);
     }
 }
 
-gboolean keyboard_bind(GList *keylist, ObActionsAct *action)
+gboolean keyboard_bind(GList *keylist, ObActionsAct *action, gboolean grab)
 {
     KeyBindingTree *tree, *t;
     gboolean conflict;
@@ -142,7 +143,7 @@ gboolean keyboard_bind(GList *keylist, ObActionsAct *action)
     g_assert(keylist != NULL);
     g_assert(action != NULL);
 
-    if (!(tree = tree_build(keylist)))
+    if (!(tree = tree_build(keylist, grab)))
         return FALSE;
 
     if ((t = tree_find(tree, &conflict)) != NULL) {
index 1c55e05079a8b673b776ffa656a2143e42a1d7c9..b3fa43cf7fafe6798b4cab6adcbeaa1d042e0c58 100644 (file)
@@ -35,7 +35,7 @@ void keyboard_startup(gboolean reconfig);
 void keyboard_shutdown(gboolean reconfig);
 
 void keyboard_chroot(GList *keylist);
-gboolean keyboard_bind(GList *keylist, struct _ObActionsAct *action);
+gboolean keyboard_bind(GList *keylist, struct _ObActionsAct *action, gboolean grab);
 void keyboard_unbind_all();
 
 void keyboard_event(struct _ObClient *client, const XEvent *e);
index fb26624d0732d88105c97094d036137d5d5fcf9d..c167495ddd0ac9db09cb83f4367667c4b1df4291 100644 (file)
@@ -44,7 +44,7 @@ void tree_destroy(KeyBindingTree *tree)
     }
 }
 
-KeyBindingTree *tree_build(GList *keylist)
+KeyBindingTree *tree_build(GList *keylist, gboolean grab)
 {
     GList *it;
     KeyBindingTree *ret = NULL, *p;
@@ -62,6 +62,7 @@ KeyBindingTree *tree_build(GList *keylist)
             ret->keylist = g_list_prepend(ret->keylist,
                                           g_strdup(kit->data)); /* deep copy */
         ret->first_child = p;
+        ret->grab = grab;
         if (p != NULL) p->parent = ret;
         if (!translate_key(it->data, &ret->state, &ret->key)) {
             tree_destroy(ret);
index 391cb154fb91a5cc61c2f12ac8771dd8a17b91b3..cf9e802826beb03e4a7591d809d745ad90837d6a 100644 (file)
@@ -24,6 +24,7 @@
 typedef struct KeyBindingTree {
     guint state;
     guint key;
+    gboolean grab;
     GList *keylist;
     GSList *actions; /* list of Action pointers */
     gboolean chroot;
@@ -37,7 +38,7 @@ typedef struct KeyBindingTree {
 } KeyBindingTree;
 
 void tree_destroy(KeyBindingTree *tree);
-KeyBindingTree *tree_build(GList *keylist);
+KeyBindingTree *tree_build(GList *keylist, gboolean grab);
 void tree_assimilate(KeyBindingTree *node);
 KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict);
 gboolean tree_chroot(KeyBindingTree *tree, GList *keylist);
index 2c666e3f3eceb0386e05f2252d4e8d9d58823104..ca1bc71c801ab5a4451f9f27de7827485b6d5ed3 100644 (file)
@@ -28,7 +28,7 @@
 #include "config.h"
 #include "render/theme.h"
 
-#define PADDING 2
+#define PADDING 0
 #define SEPARATOR_HEIGHT 3
 #define MAX_MENU_WIDTH 400
 
@@ -232,27 +232,13 @@ static void menu_frame_place_topmenu(ObMenuFrame *self, gint *x, gint *y)
     gint dx, dy;
 
     if (config_menu_middle) {
-        gint myx;
 
-        myx = *x;
-        *y -= self->area.height / 2;
+        *x -= self->area.width / 2;
 
-        /* try to the right of the cursor */
-        menu_frame_move_on_screen(self, myx, *y, &dx, &dy);
+        /* try below the cursor */
+        menu_frame_move_on_screen(self, *x, *y, &dx, &dy);
         self->direction_right = TRUE;
-        if (dx != 0) {
-            /* try to the left of the cursor */
-            myx = *x - self->area.width;
-            menu_frame_move_on_screen(self, myx, *y, &dx, &dy);
-            self->direction_right = FALSE;
-        }
-        if (dx != 0) {
-            /* if didnt fit on either side so just use what it says */
-            myx = *x;
-            menu_frame_move_on_screen(self, myx, *y, &dx, &dy);
-            self->direction_right = TRUE;
-        }
-        *x = myx + dx;
+        *x += dx;
         *y += dy;
     } else {
         gint myx, myy;
@@ -753,6 +739,8 @@ void menu_frame_render(ObMenuFrame *self)
         h += th;
     }
 
+    w += 20;
+
     /* if the last entry is a labeled separator, then make its border
        overlap with the menu's outside border */
     it = g_list_last(self->entries);
index 0c758cfdf4bd4c762833522c5c12c89dfb7003ed..6dec83efc672798f7147828aa22301e62251b9a4 100644 (file)
@@ -113,6 +113,33 @@ static void parse_env();
 static void parse_args(gint *argc, gchar **argv);
 static Cursor load_cursor(const gchar *name, guint fontval);
 
+gboolean haxxor_func(gpointer data)
+{
+    int *foo = data;
+    static int dir = 1;
+    *foo += dir;
+    if (*foo >= 200 || *foo <= 0)
+        dir = -dir;
+
+    Colormap cm = RrColormap(ob_rr_inst);
+    static XColor xcb, xcg;
+    xcg.red = *foo << 8;
+    xcg.blue = (*foo / 4) << 8;
+    xcg.green = *foo / 2 << 8;
+
+    xcb.red = 0;
+    xcb.blue = (196 - *foo / 4) << 8;
+    xcb.green = 0;
+    XAllocColor(ob_display, cm, &xcg);
+    XAllocColor(ob_display, cm, &xcb);
+//    XAllocNamedColor(ob_display, cm, "dark blue", &xcb, &xcb);
+    static int i;
+    for (i = 1; i <= OB_CURSOR_NORTHWEST; i++)
+        XRecolorCursor(ob_display, cursors[i], &xcb, &xcg);
+
+    return TRUE;
+}
+
 gint main(gint argc, gchar **argv)
 {
     gchar *program_name;
@@ -213,7 +240,13 @@ gint main(gint argc, gchar **argv)
     cursors[OB_CURSOR_WEST] = load_cursor("left_side", XC_left_side);
     cursors[OB_CURSOR_NORTHWEST] = load_cursor("top_left_corner",
                                                XC_top_left_corner);
-
+/*
+    int color = 0;
+    ob_main_loop_timeout_add(ob_main_loop,
+                             25000,
+                             haxxor_func,
+                             &color, NULL);
+*/
 
     prop_startup(); /* get atoms values for the display */
     extensions_query_all(); /* find which extensions are present */
index 6a97c36328e50b389a27489a94b1b9f1efda538f..37eb83fe7eaea78b71728d7333ba65eedc2af2fb 100644 (file)
@@ -163,14 +163,14 @@ static gboolean place_random(ObClient *client, gint *x, gint *y)
     return TRUE;
 }
 
-static GSList* area_add(GSList *list, Rect *a)
+GSList* area_add(GSList *list, Rect *a)
 {
     Rect *r = g_new(Rect, 1);
     *r = *a;
     return g_slist_prepend(list, r);
 }
 
-static GSList* area_remove(GSList *list, Rect *a)
+GSList* area_remove(GSList *list, Rect *a)
 {
     GSList *sit;
     GSList *result = NULL;
index e2f1d4e40c405e540d2a7da89916165a2951433e..abfbe4bc7935ded2d2fc026f2fb47c831e3b83e2 100644 (file)
@@ -28,6 +28,7 @@ struct _ObAppSettings;
 typedef enum
 {
     OB_PLACE_POLICY_SMART,
+    OB_PLACE_POLICY_RANDOM,
     OB_PLACE_POLICY_MOUSE
 } ObPlacePolicy;
 
index d49148fffbc8727320aa7bca6da1429fbe1b5598..0dacd2c958c0dc179f40a86299c9647cfa512195 100644 (file)
@@ -180,9 +180,15 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
 
     /* get the height, which is also used for the icon width */
     emptyy = t + b + ob_rr_theme->paddingy * 2;
-    if (self->h)
-        texth = self->h - emptyy;
-    h = texth * self->iconhm + emptyy;
+    if (self->hasicon) {
+        if (self->h)
+            h = self->h - emptyy;
+        h = h * self->iconhm + emptyy;
+    } else {
+        if (self->h)
+            texth = self->h - emptyy;
+        h = texth * self->iconhm + emptyy;
+    }
 
     if (self->textw)
         textw = self->textw;
@@ -191,8 +197,8 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
 
     emptyx = l + r + ob_rr_theme->paddingx * 2;
     if (self->hasicon) {
-        iconw = texth * self->iconwm;
-        iconh = texth * self->iconhm;
+        iconw = h * self->iconwm;
+        iconh = h * self->iconhm;
         textx += iconw + ob_rr_theme->paddingx;
         if (textw)
             emptyx += ob_rr_theme->paddingx; /* between the icon and text */
@@ -418,6 +424,7 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
             break;
         default:
             g_assert_not_reached();
+            return;
         }
         break;
     case OB_ORIENTATION_VERT:
@@ -444,10 +451,12 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
             break;
         default:
             g_assert_not_reached();
+            return;
         }
         break;
     default:
         g_assert_not_reached();
+        return;
     }
 
     rown = n;
index 46d688c828dcea45235459004164c268e724ce2e..e5924e0338a847add61cd7edefad08134057d1b5 100644 (file)
@@ -171,10 +171,12 @@ void prop_startup()
 */
 
     CREATE(openbox_pid, "_OPENBOX_PID");
+    CREATE(ob_focus, "_OB_FOCUS");
     CREATE(ob_theme, "_OB_THEME");
     CREATE(ob_wm_action_undecorate, "_OB_WM_ACTION_UNDECORATE");
     CREATE(ob_wm_state_undecorated, "_OB_WM_STATE_UNDECORATED");
     CREATE(ob_control, "_OB_CONTROL");
+    CREATE(ob_client_menu, "_OB_CLIENT_MENU");
 }
 
 #include <X11/Xutil.h>
index 914c1f61fc7e6e03c894a47df34de42111c77af9..7f6575405d3240bc2c373e07f13f00dd2010d6a9 100644 (file)
@@ -190,11 +190,13 @@ typedef struct Atoms {
 
     /* Openbox specific atoms */
 
+    Atom ob_focus;
     Atom ob_wm_action_undecorate;
     Atom ob_wm_state_undecorated;
-    Atom openbox_pid; /* this is depreecated in favour of ob_control */
+    Atom openbox_pid; /* this is deprecated in favour of ob_control */
     Atom ob_theme;
     Atom ob_control;
+    Atom ob_client_menu;
 } Atoms;
 Atoms prop_atoms;
 
index b8f24893e8ebd26d8b7d543e47770dd2817b6024..17ee4267aae8f6b305e6709876ba7b0c78da940d 100644 (file)
@@ -22,6 +22,7 @@
 #include "stacking.h"
 #include "screen.h"
 #include "config.h"
+#include "dock.h"
 #include "parser/parse.h"
 
 #include <glib.h>
@@ -61,8 +62,6 @@ void resist_move_windows(ObClient *c, gint resist, gint *x, gint *y)
 
         /* don't snap to self or non-visibles */
         if (!target->frame->visible || target == c) continue;
-        /* don't snap to windows set to below and skip_taskbar (desklets) */
-        if (target->below && !c->below && target->skip_taskbar) continue;
 
         tl = RECT_LEFT(target->frame->area) - 1;
         tt = RECT_TOP(target->frame->area) - 1;
@@ -108,9 +107,46 @@ void resist_move_windows(ObClient *c, gint resist, gint *x, gint *y)
                         *x = tr - w, snapx = target;
                 }
             }
+            if (snapx && snapy) break;
         }
 
-        if (snapx && snapy) break;
+        extern ObDock *dock;
+        gint dl, dt, dr, db;
+        dl = dock->x - 1;
+        dt = dock->y - 1;
+        dr = dl + dock->w + 1;
+        db = dt + dock->h + 1;
+        snapx = snapy = NULL;
+        if (ct < db && cb > dt) {
+            if (cl >= dr && l < dr && l >= dr - config_resist_win)
+                *x = dr, snapx = dock;
+            else if (cr <= dl && r > dl &&
+                     r <= dl + config_resist_win)
+                *x = dl - w + 1, snapx = dock;
+            if (snapx != NULL) {
+                if (ct > dt && t <= dt &&
+                    t > dt - config_resist_win)
+                    *y = dt + 1;
+                else if (cb < db && b >= db &&
+                         b < db + config_resist_win)
+                    *y = db - h;
+            }
+        }
+        if (cl < dr && cr > dl) {
+            if (ct >= db && t < db && t >= db - config_resist_win)
+                *y = db, snapy = dock;
+            else if (cb <= dt && b > dt &&
+                     b <= dt + config_resist_win)
+                *y = dt - h + 1, snapy = dock;
+            if (snapy != NULL) {
+                if (cl > dl && l <= dl &&
+                    l > dl - config_resist_win)
+                    *x = dl + 1;
+                else if (cr < dr && r >= dr &&
+                         r < dr + config_resist_win)
+                    *x = dr - w;
+            }
+        }
     }
 
     frame_frame_gravity(c->frame, x, y);
@@ -219,8 +255,6 @@ void resist_size_windows(ObClient *c, gint resist, gint *w, gint *h,
 
         /* don't snap to invisibles or ourself */
         if (!target->frame->visible || target == c) continue;
-        /* don't snap to windows set to below and skip_taskbar (desklets) */
-        if (target->below && !c->below && target->skip_taskbar) continue;
 
         tl = RECT_LEFT(target->frame->area);
         tr = RECT_RIGHT(target->frame->area);
@@ -282,9 +316,56 @@ void resist_size_windows(ObClient *c, gint resist, gint *w, gint *h,
                 }
             }
         }
-
         /* snapped both ways */
         if (snapx && snapy) break;
+
+    }{
+        extern ObDock *dock;
+        int dl, dt, dr, db;
+        dl = dock->x;
+        dt = dock->y;
+        dr = dl + dock->w - 1;
+        db = dt + dock->h - 1;
+        if (t < db && b > dt) {
+            switch (corn) {
+            case OB_CORNER_TOPLEFT:
+            case OB_CORNER_BOTTOMLEFT:
+                dlt = l;
+                drb = r + *w - c->frame->area.width;
+                if (r < dl && drb >= dl &&
+                    drb < dl + config_resist_win)
+                    *w = dl - l;
+                break;
+            case OB_CORNER_TOPRIGHT:
+            case OB_CORNER_BOTTOMRIGHT:
+                dlt = l - *w + c->frame->area.width;
+                drb = r;
+                if (l > dr && dlt <= dr &&
+                    dlt > dr - config_resist_win)
+                    *w = r - dr;
+                break;
+            }
+        }
+        if (l < dr && r > dl) {
+            switch (corn) {
+            case OB_CORNER_TOPLEFT:
+            case OB_CORNER_TOPRIGHT:
+                dlt = t;
+                drb = b + *h - c->frame->area.height;
+                if (b < dt && drb >= dt &&
+                    drb < dt + config_resist_win)
+                    *h = dt - t;
+                break;
+            case OB_CORNER_BOTTOMLEFT:
+            case OB_CORNER_BOTTOMRIGHT:
+                dlt = t - *h + c->frame->area.height;
+                drb = b;
+                if (t > db && dlt <= db &&
+                    dlt > db - config_resist_win)
+                    *h = b - db;
+                break;
+            }
+        }
     }
 }
 
index 9bbd13d183181208873b0769fa1957882e28babe..23b600093dca6a9b7fbff33c6ca1c47adf64e532 100644 (file)
 
 static gboolean screen_validate_layout(ObDesktopLayout *l);
 static gboolean replace_wm();
-static void     screen_tell_ksplash();
+//static void     screen_tell_ksplash();
 
 guint    screen_num_desktops;
 guint    screen_num_monitors;
 guint    screen_desktop;
-guint    screen_last_desktop;
+guint    screen_last_desktop = 1;
 Size     screen_physical_size;
 gboolean screen_showing_desktop;
 ObDesktopLayout screen_desktop_layout;
@@ -308,11 +308,11 @@ gboolean screen_annex()
                 net_supported, atom, supported, num_support);
     g_free(supported);
 
-    screen_tell_ksplash();
+//    screen_tell_ksplash();
 
     return TRUE;
 }
-
+#if 0
 static void screen_tell_ksplash()
 {
     XEvent e;
@@ -346,7 +346,7 @@ static void screen_tell_ksplash()
     XSendEvent(ob_display, RootWindow(ob_display, ob_screen),
                False, SubstructureNotifyMask, &e );
 }
-
+#endif
 void screen_startup(gboolean reconfig)
 {
     gchar **names = NULL;
@@ -1572,7 +1572,7 @@ void screen_set_root_cursor()
 {
     if (sn_app_starting())
         XDefineCursor(ob_display, RootWindow(ob_display, ob_screen),
-                      ob_cursor(OB_CURSOR_BUSYPOINTER));
+                      ob_cursor(OB_CURSOR_BUSY));
     else
         XDefineCursor(ob_display, RootWindow(ob_display, ob_screen),
                       ob_cursor(OB_CURSOR_POINTER));
index 5b2b4ebee056ff60d3ffd6580dfa74a7d4db5303..a17158ee1d1784f64db4a694d0b27bb4f9bd3067 100644 (file)
@@ -31,8 +31,12 @@ static guint translate_modifier(gchar *str)
 
     if (!g_ascii_strcasecmp("Mod1", str)) mask = Mod1Mask;
     else if (!g_ascii_strcasecmp("Mod2", str)) mask = Mod2Mask;
-    else if (!g_ascii_strcasecmp("Mod3", str)) mask = Mod3Mask;
-    else if (!g_ascii_strcasecmp("Mod4", str)) mask = Mod4Mask;
+    else if (!g_ascii_strcasecmp("Mod3", str) ||
+             !g_ascii_strcasecmp("M", str))
+        mask = Mod3Mask;
+    else if (!g_ascii_strcasecmp("Mod4", str) ||
+             !g_ascii_strcasecmp("W", str))
+        mask = Mod4Mask;
     else if (!g_ascii_strcasecmp("Mod5", str)) mask = Mod5Mask;
 
     else if (!g_ascii_strcasecmp("Control", str) ||
index 8d389d8b5e81b73ff5015d3ee2743c09cb313f0d..0aa89dbea140aaf929de863e3a4128ff47095416 100644 (file)
@@ -158,8 +158,8 @@ static void font_measure_full(const RrFont *f, const gchar *str,
     rect.width = (rect.width + PANGO_SCALE - 1) / PANGO_SCALE;
     rect.height = (rect.height + PANGO_SCALE - 1) / PANGO_SCALE;
 #endif
-    *x = rect.width + ABS(shadow_x) + 4 /* we put a 2 px edge on each side */;
-    *y = rect.height + ABS(shadow_y);
+    *x = rect.width + /* ABS(shadow_x) +*/ 4 /* we put a 2 px edge on each side */;
+    *y = rect.height /*+ ABS(shadow_y) */;
 }
 
 RrSize *RrFontMeasureString(const RrFont *f, const gchar *str,
@@ -173,7 +173,7 @@ RrSize *RrFontMeasureString(const RrFont *f, const gchar *str,
 
 gint RrFontHeight(const RrFont *f, gint shadow_y)
 {
-    return (f->ascent + f->descent) / PANGO_SCALE + ABS(shadow_y);
+    return (f->ascent + f->descent) / PANGO_SCALE + 0-1;//ABS(shadow_y);
 }
 
 static inline int font_calculate_baseline(RrFont *f, gint height)
index 307e2629838fc52f7d4ce90030e8ec1e70963b4e..b0840b751b47a93be6a06fb653a3125e224ba199 100644 (file)
@@ -67,9 +67,9 @@ gint main()
     inst = RrInstanceNew(ob_display, ob_screen);
 
     look = RrAppearanceNew(inst, 0);
-    look->surface.grad = RR_SURFACE_PYRAMID;
-    look->surface.secondary = RrColorParse(inst, "Yellow");
-    look->surface.primary = RrColorParse(inst, "Blue");
+    look->surface.grad = RR_SURFACE_MIRROR_HORIZONTAL;
+    look->surface.secondary = RrColorParse(inst, "Dark Orange");
+    look->surface.primary = RrColorParse(inst, "Dark Blue");
     look->surface.interlaced = FALSE;
     if (ob_display == NULL) {
         fprintf(stderr, "couldn't connect to X server :0\n");
@@ -83,6 +83,9 @@ gint main()
         case Expose:
             break;
         case ConfigureNotify:
+            look->surface.grad += 1;
+            if (look->surface.grad > RR_SURFACE_MIRROR_HORIZONTAL)
+                look->surface.grad = RR_SURFACE_SPLIT_VERTICAL;
             RrPaint(look, win,
                     report.xconfigure.width,
                     report.xconfigure.height);
index a793ced71f6a8021ca296f31c2d955bfbd94adba..186749fb1fe835c594874d3d9318b672b24bd8b2 100644 (file)
 #include "font.h"
 #include "mask.h"
 #include "theme.h"
-#include "icon.h"
+#ifdef MIKACHU
+# include "icon-mikamika.h"
+#else
+# include "icon.h"
+#endif
 #include "parser/parse.h"
 
 #include <X11/Xlib.h>
@@ -1361,7 +1365,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
         RrMargins(theme->a_focused_label, &fl, &ft, &fr, &fb);
         RrMargins(theme->a_unfocused_label, &ul, &ut, &ur, &ub);
         theme->label_height = theme->win_font_height + MAX(ft + fb, ut + ub);
-        theme->label_height += theme->label_height % 2;
+        //theme->label_height += theme->label_height & 1;
 
         /* this would be nice I think, since padding.width can now be 0,
            but it breaks frame.c horribly and I don't feel like fixing that
@@ -1421,6 +1425,8 @@ void RrThemeFree(RrTheme *theme)
         RrColorFree(theme->menu_selected_color);
         RrColorFree(theme->menu_disabled_color);
         RrColorFree(theme->menu_disabled_selected_color);
+//        RrColorFree(theme->focus_cycle_inner);
+//        RrColorFree(theme->focus_cycle_outer);
         RrColorFree(theme->title_focused_shadow_color);
         RrColorFree(theme->title_unfocused_shadow_color);
         RrColorFree(theme->osd_color);
index 2c35284f466b50dba4855edffc75bd57cdf1f572..154ecc2b7a66e7beaf6d9eeb498ba83f97560fd4 100644 (file)
@@ -87,6 +87,8 @@ struct _RrTheme {
     RrColor *menu_selected_color;
     RrColor *menu_disabled_color;
     RrColor *menu_disabled_selected_color;
+//    RrColor *focus_cycle_inner;
+//    RrColor *focus_cycle_outer;
     RrColor *title_focused_shadow_color;
     gchar    title_focused_shadow_alpha;
     RrColor *title_unfocused_shadow_color;
index 315a10fb23d2b1012ffcebff7768838df4c2e0e4..a3aa3da14cb64dbf08e7910b602fe725e192eaba 100644 (file)
@@ -23,6 +23,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 
 Window findClient(Display *d, Window win)
 {
@@ -170,6 +173,10 @@ int main(int argc, char **argv)
         XPutImage(d, p, DefaultGC(d, s), i[j], 0, 0, x, 0,
                   i[j]->width, i[j]->height);
         x += i[j]->width;
+        char *filename;
+        asprintf(&filename, "icon%i.raw", j);
+        int fd = open(filename, O_CREAT | O_RDWR);
+        write(fd, i[j]->data, i[j]->width * i[j]->height * i[j]->depth);
         XDestroyImage(i[j]);
     }
 
index d1a63e2fccbe82f891a7fc2d51c691ef3e39dab9..133a89ad3e4180d95d3e72c88f385271c2b133d8 100644 (file)
@@ -46,8 +46,8 @@ int main () {
       XDestroyWindow(display, win);
       XSync(display, False);
 
-      break;
-      sleep(2);
+      //break;
+      usleep(200000);
   }
 
   return 1;
index c29e3005e302e04f7392945637c148774856dfce..37b533ef197b744a243ad5d81cb706282208b28b 100644 (file)
@@ -25,7 +25,6 @@ int main () {
   Display   *display;
   Window     win;
   XEvent     report;
-  Atom       _net_fs, _net_state;
   XEvent     msg;
   int        x=50,y=50,h=100,w=400;
   XWMHints   hint;
@@ -37,9 +36,6 @@ int main () {
     return 0;
   }
 
-  _net_state = XInternAtom(display, "_NET_WM_STATE", False);
-  _net_fs = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", False);
-
   win = XCreateWindow(display, RootWindow(display, 0),
                      x, y, w, h, 10, CopyFromParent, CopyFromParent,
                      CopyFromParent, 0, NULL);