From 228299df6f2676404889c330ea3911d8386df0df Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 20 Jul 2007 22:13:43 +0200 Subject: [PATCH] Add mikabox on mikabox branch this time, yay! Signed-off-by: Mikael Magnusson --- Makefile.am | 3 + m4/openbox.m4 | 1 - openbox/actions/all.c | 1 + openbox/actions/all.h | 1 + openbox/actions/iconify.c | 14 ++++- openbox/actions/toggledebug.c | 22 +++++++ openbox/client.c | 27 +++++++-- openbox/client.h | 2 + openbox/client_list_combined_menu.c | 11 ++-- openbox/client_list_menu.c | 14 ++--- openbox/client_menu.c | 2 + openbox/config.c | 18 +++++- openbox/config.h | 4 ++ openbox/debug.c | 8 +-- openbox/dock.c | 2 +- openbox/event.c | 50 ++++++++++++++-- openbox/extensions.c | 30 ++++++---- openbox/focus_cycle_indicator.c | 4 +- openbox/keyboard.c | 11 ++-- openbox/keyboard.h | 2 +- openbox/keytree.c | 3 +- openbox/keytree.h | 3 +- openbox/menuframe.c | 26 +++----- openbox/openbox.c | 35 ++++++++++- openbox/place.c | 4 +- openbox/place.h | 1 + openbox/popup.c | 19 ++++-- openbox/prop.c | 2 + openbox/prop.h | 4 +- openbox/resist.c | 93 +++++++++++++++++++++++++++-- openbox/screen.c | 12 ++-- openbox/translate.c | 8 ++- render/font.c | 6 +- render/test.c | 9 ++- render/theme.c | 10 +++- render/theme.h | 2 + tests/icons.c | 7 +++ tests/showhide.c | 4 +- tests/urgent.c | 4 -- 39 files changed, 370 insertions(+), 109 deletions(-) create mode 100644 openbox/actions/toggledebug.c diff --git a/Makefile.am b/Makefile.am index dd6d6835..29c65e63 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/m4/openbox.m4 b/m4/openbox.m4 index 29114360..40281f41 100644 --- a/m4/openbox.m4 +++ b/m4/openbox.m4 @@ -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]) diff --git a/openbox/actions/all.c b/openbox/actions/all.c index 06858c05..db37840b 100644 --- a/openbox/actions/all.c +++ b/openbox/actions/all.c @@ -38,4 +38,5 @@ void action_all_startup() action_growtoedge_startup(); action_if_startup(); action_focustobottom_startup(); + action_toggledebug_startup(); } diff --git a/openbox/actions/all.h b/openbox/actions/all.h index 5f3f573f..95b69e1f 100644 --- a/openbox/actions/all.h +++ b/openbox/actions/all.h @@ -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 diff --git a/openbox/actions/iconify.c b/openbox/actions/iconify.c index b82684ea..1ef2da39 100644 --- a/openbox/actions/iconify.c +++ b/openbox/actions/iconify.c @@ -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 index 00000000..82c3c54b --- /dev/null +++ b/openbox/actions/toggledebug.c @@ -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; +} diff --git a/openbox/client.c b/openbox/client.c index a7b616d2..2aa0f0e7 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -48,6 +48,7 @@ #include #include +#include /*! 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); diff --git a/openbox/client.h b/openbox/client.h index cba1aebb..8e11699e 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -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); diff --git a/openbox/client_list_combined_menu.c b/openbox/client_list_combined_menu.c index 556245df..c2fc0238 100644 --- a/openbox/client_list_combined_menu.c +++ b/openbox/client_list_combined_menu.c @@ -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); } diff --git a/openbox/client_list_menu.c b/openbox/client_list_menu.c index 25bb6230..3857d2ab 100644 --- a/openbox/client_list_menu.c +++ b/openbox/client_list_menu.c @@ -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); } diff --git a/openbox/client_menu.c b/openbox/client_menu.c index 43f98c74..314e89b7 100644 --- a/openbox/client_menu.c +++ b/openbox/client_menu.c @@ -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); diff --git a/openbox/config.c b/openbox/config.c index 0d6efc92..2cdf1fb2 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -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); diff --git a/openbox/config.h b/openbox/config.h index 42bf3534..3ea6e7a4 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -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; diff --git a/openbox/debug.c b/openbox/debug.c index 0fceba48..faabc63c 100644 --- a/openbox/debug.c +++ b/openbox/debug.c @@ -23,18 +23,18 @@ #include #include -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: "); diff --git a/openbox/dock.c b/openbox/dock.c index 990c8208..518f0671 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -31,7 +31,7 @@ EnterWindowMask | LeaveWindowMask) #define DOCKAPP_EVENT_MASK (StructureNotifyMask) -static ObDock *dock; +ObDock *dock; StrutPartial dock_strut; diff --git a/openbox/event.c b/openbox/event.c index c119573e..e29623ca 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -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); diff --git a/openbox/extensions.c b/openbox/extensions.c index 89a96576..729ed289 100644 --- a/openbox/extensions.c +++ b/openbox/extensions.c @@ -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); + } } diff --git a/openbox/focus_cycle_indicator.c b/openbox/focus_cycle_indicator.c index 79071314..0318069b 100644 --- a/openbox/focus_cycle_indicator.c +++ b/openbox/focus_cycle_indicator.c @@ -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; diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 6e45e5c4..bb4e4fce 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -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) { diff --git a/openbox/keyboard.h b/openbox/keyboard.h index 1c55e050..b3fa43cf 100644 --- a/openbox/keyboard.h +++ b/openbox/keyboard.h @@ -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); diff --git a/openbox/keytree.c b/openbox/keytree.c index fb26624d..c167495d 100644 --- a/openbox/keytree.c +++ b/openbox/keytree.c @@ -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); diff --git a/openbox/keytree.h b/openbox/keytree.h index 391cb154..cf9e8028 100644 --- a/openbox/keytree.h +++ b/openbox/keytree.h @@ -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); diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 2c666e3f..ca1bc71c 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -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); diff --git a/openbox/openbox.c b/openbox/openbox.c index 0c758cfd..6dec83ef 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -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 */ diff --git a/openbox/place.c b/openbox/place.c index 6a97c363..37eb83fe 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -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; diff --git a/openbox/place.h b/openbox/place.h index e2f1d4e4..abfbe4bc 100644 --- a/openbox/place.h +++ b/openbox/place.h @@ -28,6 +28,7 @@ struct _ObAppSettings; typedef enum { OB_PLACE_POLICY_SMART, + OB_PLACE_POLICY_RANDOM, OB_PLACE_POLICY_MOUSE } ObPlacePolicy; diff --git a/openbox/popup.c b/openbox/popup.c index d49148ff..0dacd2c9 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -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; diff --git a/openbox/prop.c b/openbox/prop.c index 46d688c8..e5924e03 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -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 diff --git a/openbox/prop.h b/openbox/prop.h index 914c1f61..7f657540 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -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; diff --git a/openbox/resist.c b/openbox/resist.c index b8f24893..17ee4267 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -22,6 +22,7 @@ #include "stacking.h" #include "screen.h" #include "config.h" +#include "dock.h" #include "parser/parse.h" #include @@ -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; + } + } } } diff --git a/openbox/screen.c b/openbox/screen.c index 9bbd13d1..23b60009 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -52,12 +52,12 @@ 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)); diff --git a/openbox/translate.c b/openbox/translate.c index 5b2b4ebe..a17158ee 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -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) || diff --git a/render/font.c b/render/font.c index 8d389d8b..0aa89dbe 100644 --- a/render/font.c +++ b/render/font.c @@ -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) diff --git a/render/test.c b/render/test.c index 307e2629..b0840b75 100644 --- a/render/test.c +++ b/render/test.c @@ -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); diff --git a/render/theme.c b/render/theme.c index a793ced7..186749fb 100644 --- a/render/theme.c +++ b/render/theme.c @@ -22,7 +22,11 @@ #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 @@ -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); diff --git a/render/theme.h b/render/theme.h index 2c35284f..154ecc2b 100644 --- a/render/theme.h +++ b/render/theme.h @@ -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; diff --git a/tests/icons.c b/tests/icons.c index 315a10fb..a3aa3da1 100644 --- a/tests/icons.c +++ b/tests/icons.c @@ -23,6 +23,9 @@ #include #include #include +#include +#include +#include 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]); } diff --git a/tests/showhide.c b/tests/showhide.c index d1a63e2f..133a89ad 100644 --- a/tests/showhide.c +++ b/tests/showhide.c @@ -46,8 +46,8 @@ int main () { XDestroyWindow(display, win); XSync(display, False); - break; - sleep(2); + //break; + usleep(200000); } return 1; diff --git a/tests/urgent.c b/tests/urgent.c index c29e3005..37b533ef 100644 --- a/tests/urgent.c +++ b/tests/urgent.c @@ -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); -- 2.34.1