diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2007-12-18 21:12:52 +0100 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@comhem.se> | 2007-12-18 21:12:52 +0100 |
| commit | 2b8b5da04b14af1639143cc332874c7e1a03a8bb (patch) | |
| tree | 74fc76cd53dc5684b8009960e896ecbc91cf0891 /openbox | |
| parent | 9586ad246dae1f1de89f2070722cfa0c0c41c477 (diff) | |
| parent | 46f90bca8ab55a2f43bf33af1adf178bd0bd81d9 (diff) | |
Merge branch 'backport'
Diffstat (limited to 'openbox')
66 files changed, 185 insertions, 160 deletions
diff --git a/openbox/actions.c b/openbox/actions.c index cfe0bdde..75d4af05 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -275,12 +275,12 @@ void actions_run_acts(GSList *acts, } } -gboolean actions_interactive_act_running() +gboolean actions_interactive_act_running(void) { return interactive_act != NULL; } -void actions_interactive_cancel_act() +void actions_interactive_cancel_act(void) { if (interactive_act) { interactive_act->def->i_cancel(interactive_act->options); @@ -306,7 +306,7 @@ static gboolean actions_interactive_begin_act(ObActionsAct *act, guint state) return FALSE; } -static void actions_interactive_end_act() +static void actions_interactive_end_act(void) { if (interactive_act) { ungrab_keyboard(); diff --git a/openbox/actions/addremovedesktop.c b/openbox/actions/addremovedesktop.c index c8904d3c..8125b9bb 100644 --- a/openbox/actions/addremovedesktop.c +++ b/openbox/actions/addremovedesktop.c @@ -14,7 +14,7 @@ static gpointer setup_remove_func(ObParseInst *i, static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_addremovedesktop_startup() +void action_addremovedesktop_startup(void) { actions_register("AddDesktop", setup_add_func, diff --git a/openbox/actions/all.c b/openbox/actions/all.c index 06858c05..47141ac6 100644 --- a/openbox/actions/all.c +++ b/openbox/actions/all.c @@ -1,6 +1,6 @@ #include "all.h" -void action_all_startup() +void action_all_startup(void) { action_execute_startup(); action_debug_startup(); diff --git a/openbox/actions/breakchroot.c b/openbox/actions/breakchroot.c index bfdbf16c..9804091b 100644 --- a/openbox/actions/breakchroot.c +++ b/openbox/actions/breakchroot.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_breakchroot_startup() +void action_breakchroot_startup(void) { actions_register("BreakChroot", NULL, NULL, diff --git a/openbox/actions/close.c b/openbox/actions/close.c index 37260e13..ab75e05d 100644 --- a/openbox/actions/close.c +++ b/openbox/actions/close.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_close_startup() +void action_close_startup(void) { actions_register("Close", NULL, NULL, diff --git a/openbox/actions/cyclewindows.c b/openbox/actions/cyclewindows.c index 7b4bd11e..965ac993 100644 --- a/openbox/actions/cyclewindows.c +++ b/openbox/actions/cyclewindows.c @@ -31,7 +31,7 @@ static void i_cancel_func(gpointer options); static void end_cycle(gboolean cancel, guint state, Options *o); -void action_cyclewindows_startup() +void action_cyclewindows_startup(void) { actions_register("NextWindow", setup_forward_func, free_func, run_func, i_input_func, i_cancel_func); diff --git a/openbox/actions/debug.c b/openbox/actions/debug.c index bbc9cca2..f71b685d 100644 --- a/openbox/actions/debug.c +++ b/openbox/actions/debug.c @@ -9,7 +9,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_debug_startup() +void action_debug_startup(void) { actions_register("Debug", setup_func, diff --git a/openbox/actions/decorations.c b/openbox/actions/decorations.c index bee25f3e..e85fb8ef 100644 --- a/openbox/actions/decorations.c +++ b/openbox/actions/decorations.c @@ -5,7 +5,7 @@ static gboolean run_func_on(ObActionsData *data, gpointer options); static gboolean run_func_off(ObActionsData *data, gpointer options); static gboolean run_func_toggle(ObActionsData *data, gpointer options); -void action_decorations_startup() +void action_decorations_startup(void) { actions_register("Decorate", NULL, NULL, run_func_on, NULL, NULL); actions_register("Undecorate", NULL, NULL, run_func_off, NULL, NULL); diff --git a/openbox/actions/desktop.c b/openbox/actions/desktop.c index 75949be2..69275252 100644 --- a/openbox/actions/desktop.c +++ b/openbox/actions/desktop.c @@ -32,7 +32,7 @@ static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); -void action_desktop_startup() +void action_desktop_startup(void) { actions_register("GoToDesktop", setup_go_func, g_free, run_func, NULL, NULL); diff --git a/openbox/actions/directionalwindows.c b/openbox/actions/directionalwindows.c index 884ebcb6..707659eb 100644 --- a/openbox/actions/directionalwindows.c +++ b/openbox/actions/directionalwindows.c @@ -31,7 +31,7 @@ static void i_cancel_func(gpointer options); static void end_cycle(gboolean cancel, guint state, Options *o); -void action_directionalwindows_startup() +void action_directionalwindows_startup(void) { actions_register("DirectionalCycleWindows", setup_cycle_func, free_func, run_func, i_input_func, i_cancel_func); diff --git a/openbox/actions/dockautohide.c b/openbox/actions/dockautohide.c index 9e035b81..5e5382d4 100644 --- a/openbox/actions/dockautohide.c +++ b/openbox/actions/dockautohide.c @@ -4,7 +4,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_dockautohide_startup() +void action_dockautohide_startup(void) { actions_register("ToggleDockAutoHide", NULL, NULL, diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index caf1347b..02de0154 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -23,7 +23,7 @@ static gboolean i_input_func(guint initial_state, static void i_cancel_func(gpointer options); */ -void action_execute_startup() +void action_execute_startup(void) { actions_register("Execute", setup_func, diff --git a/openbox/actions/exit.c b/openbox/actions/exit.c index 68b5cef4..662c984a 100644 --- a/openbox/actions/exit.c +++ b/openbox/actions/exit.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_exit_startup() +void action_exit_startup(void) { actions_register("Exit", NULL, NULL, diff --git a/openbox/actions/focus.c b/openbox/actions/focus.c index ea7a6a2c..67c1479f 100644 --- a/openbox/actions/focus.c +++ b/openbox/actions/focus.c @@ -11,7 +11,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_focus_startup() +void action_focus_startup(void) { actions_register("Focus", setup_func, diff --git a/openbox/actions/focustobottom.c b/openbox/actions/focustobottom.c index 74d48e33..49c945b9 100644 --- a/openbox/actions/focustobottom.c +++ b/openbox/actions/focustobottom.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_focustobottom_startup() +void action_focustobottom_startup(void) { actions_register("FocusToBottom", NULL, NULL, run_func, NULL, NULL); } diff --git a/openbox/actions/fullscreen.c b/openbox/actions/fullscreen.c index 647a78bc..7579b95d 100644 --- a/openbox/actions/fullscreen.c +++ b/openbox/actions/fullscreen.c @@ -3,7 +3,7 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options); -void action_fullscreen_startup() +void action_fullscreen_startup(void) { actions_register("ToggleFullscreen", NULL, NULL, run_func_toggle, NULL, NULL); diff --git a/openbox/actions/growtoedge.c b/openbox/actions/growtoedge.c index 44e52872..630ead10 100644 --- a/openbox/actions/growtoedge.c +++ b/openbox/actions/growtoedge.c @@ -15,7 +15,7 @@ static gpointer setup_shrink_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_growtoedge_startup() +void action_growtoedge_startup(void) { actions_register("GrowToEdge", setup_func, diff --git a/openbox/actions/iconify.c b/openbox/actions/iconify.c index b82684ea..6f14a2e0 100644 --- a/openbox/actions/iconify.c +++ b/openbox/actions/iconify.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_iconify_startup() +void action_iconify_startup(void) { actions_register("Iconify", NULL, NULL, diff --git a/openbox/actions/if.c b/openbox/actions/if.c index 25d899c1..a35c61fc 100644 --- a/openbox/actions/if.c +++ b/openbox/actions/if.c @@ -27,7 +27,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_if_startup() +void action_if_startup(void) { actions_register("If", setup_func, diff --git a/openbox/actions/kill.c b/openbox/actions/kill.c index 5e14cb7c..68244407 100644 --- a/openbox/actions/kill.c +++ b/openbox/actions/kill.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_kill_startup() +void action_kill_startup(void) { actions_register("Kill", NULL, NULL, diff --git a/openbox/actions/layer.c b/openbox/actions/layer.c index 5f0d6ce6..92fa4806 100644 --- a/openbox/actions/layer.c +++ b/openbox/actions/layer.c @@ -13,7 +13,7 @@ static gpointer setup_func_send(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); -void action_layer_startup() +void action_layer_startup(void) { actions_register("ToggleAlwaysOnTop", setup_func_top, g_free, run_func, NULL, NULL); diff --git a/openbox/actions/lower.c b/openbox/actions/lower.c index 1abf5903..3a214ea7 100644 --- a/openbox/actions/lower.c +++ b/openbox/actions/lower.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_lower_startup() +void action_lower_startup(void) { actions_register("Lower", NULL, NULL, diff --git a/openbox/actions/maximize.c b/openbox/actions/maximize.c index 8bb0cc95..bb6f470a 100644 --- a/openbox/actions/maximize.c +++ b/openbox/actions/maximize.c @@ -17,7 +17,7 @@ static gboolean run_func_on(ObActionsData *data, gpointer options); static gboolean run_func_off(ObActionsData *data, gpointer options); static gboolean run_func_toggle(ObActionsData *data, gpointer options); -void action_maximize_startup() +void action_maximize_startup(void) { actions_register("Maximize", setup_func, g_free, run_func_on, NULL, NULL); diff --git a/openbox/actions/move.c b/openbox/actions/move.c index bf140c31..1a8ea204 100644 --- a/openbox/actions/move.c +++ b/openbox/actions/move.c @@ -4,7 +4,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_move_startup() +void action_move_startup(void) { actions_register("Move", NULL, NULL, diff --git a/openbox/actions/moverelative.c b/openbox/actions/moverelative.c index deb1eae7..1d1189cd 100644 --- a/openbox/actions/moverelative.c +++ b/openbox/actions/moverelative.c @@ -13,7 +13,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_moverelative_startup() +void action_moverelative_startup(void) { actions_register("MoveRelative", setup_func, diff --git a/openbox/actions/moveresizeto.c b/openbox/actions/moveresizeto.c index 0e1f8268..860bf73a 100644 --- a/openbox/actions/moveresizeto.c +++ b/openbox/actions/moveresizeto.c @@ -25,7 +25,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_moveresizeto_startup() +void action_moveresizeto_startup(void) { actions_register("MoveResizeTo", setup_func, diff --git a/openbox/actions/movetoedge.c b/openbox/actions/movetoedge.c index 768783f2..5941bde9 100644 --- a/openbox/actions/movetoedge.c +++ b/openbox/actions/movetoedge.c @@ -13,7 +13,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_movetoedge_startup() +void action_movetoedge_startup(void) { actions_register("MoveToEdge", setup_func, diff --git a/openbox/actions/omnipresent.c b/openbox/actions/omnipresent.c index b6ba1622..030a0159 100644 --- a/openbox/actions/omnipresent.c +++ b/openbox/actions/omnipresent.c @@ -4,7 +4,7 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options); -void action_omnipresent_startup() +void action_omnipresent_startup(void) { actions_register("ToggleOmnipresent", NULL, NULL, run_func_toggle, NULL, NULL); diff --git a/openbox/actions/raise.c b/openbox/actions/raise.c index 916c27b5..5dfe281a 100644 --- a/openbox/actions/raise.c +++ b/openbox/actions/raise.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_raise_startup() +void action_raise_startup(void) { actions_register("Raise", NULL, NULL, diff --git a/openbox/actions/raiselower.c b/openbox/actions/raiselower.c index f75410ac..80fc917f 100644 --- a/openbox/actions/raiselower.c +++ b/openbox/actions/raiselower.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_raiselower_startup() +void action_raiselower_startup(void) { actions_register("RaiseLower", NULL, NULL, diff --git a/openbox/actions/reconfigure.c b/openbox/actions/reconfigure.c index 8802a37b..cef81414 100644 --- a/openbox/actions/reconfigure.c +++ b/openbox/actions/reconfigure.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_reconfigure_startup() +void action_reconfigure_startup(void) { actions_register("Reconfigure", NULL, NULL, diff --git a/openbox/actions/resize.c b/openbox/actions/resize.c index 26951370..81901bdd 100644 --- a/openbox/actions/resize.c +++ b/openbox/actions/resize.c @@ -15,7 +15,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch, gboolean shaded); -void action_resize_startup() +void action_resize_startup(void) { actions_register("Resize", setup_func, diff --git a/openbox/actions/resizerelative.c b/openbox/actions/resizerelative.c index 668a063f..f705c292 100644 --- a/openbox/actions/resizerelative.c +++ b/openbox/actions/resizerelative.c @@ -15,7 +15,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_resizerelative_startup() +void action_resizerelative_startup(void) { actions_register("ResizeRelative", setup_func, diff --git a/openbox/actions/restart.c b/openbox/actions/restart.c index fff0a87f..4b52f9d3 100644 --- a/openbox/actions/restart.c +++ b/openbox/actions/restart.c @@ -9,7 +9,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_restart_startup() +void action_restart_startup(void) { actions_register("Restart", setup_func, diff --git a/openbox/actions/shade.c b/openbox/actions/shade.c index a8db0989..2342067f 100644 --- a/openbox/actions/shade.c +++ b/openbox/actions/shade.c @@ -5,7 +5,7 @@ static gboolean run_func_on(ObActionsData *data, gpointer options); static gboolean run_func_off(ObActionsData *data, gpointer options); static gboolean run_func_toggle(ObActionsData *data, gpointer options); -void action_shade_startup() +void action_shade_startup(void) { actions_register("Shade", NULL, NULL, run_func_on, NULL, NULL); actions_register("Unshade", NULL, NULL, run_func_off, NULL, NULL); diff --git a/openbox/actions/showdesktop.c b/openbox/actions/showdesktop.c index 03528362..c9ba86c4 100644 --- a/openbox/actions/showdesktop.c +++ b/openbox/actions/showdesktop.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_showdesktop_startup() +void action_showdesktop_startup(void) { actions_register("ToggleShowDesktop", NULL, NULL, diff --git a/openbox/actions/showmenu.c b/openbox/actions/showmenu.c index a36648a2..c1d53e41 100644 --- a/openbox/actions/showmenu.c +++ b/openbox/actions/showmenu.c @@ -10,7 +10,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); -void action_showmenu_startup() +void action_showmenu_startup(void) { actions_register("ShowMenu", setup_func, free_func, run_func, NULL, NULL); diff --git a/openbox/actions/unfocus.c b/openbox/actions/unfocus.c index 0527d2a0..22a9378c 100644 --- a/openbox/actions/unfocus.c +++ b/openbox/actions/unfocus.c @@ -3,7 +3,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); -void action_unfocus_startup() +void action_unfocus_startup(void) { actions_register("Unfocus", NULL, NULL, run_func, NULL, NULL); } diff --git a/openbox/client.c b/openbox/client.c index f97bd430..d0fed545 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -140,7 +140,7 @@ void client_remove_destroy_notify(ObClientCallback func) } } -void client_set_list() +void client_set_list(void) { Window *windows, *win_it; GList *it; @@ -164,7 +164,7 @@ void client_set_list() stacking_set_list(); } -void client_manage_all() +void client_manage_all(void) { guint i, j, nchild; Window w, *children; @@ -637,7 +637,7 @@ ObClient *client_fake_manage(Window window) return self; } -void client_unmanage_all() +void client_unmanage_all(void) { while (client_list != NULL) client_unmanage(client_list->data); @@ -3969,6 +3969,8 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, dock_get_area(&dock_area); detect_edge(dock_area, dir, my_head, my_size, my_edge_start, my_edge_size, dest, near_edge); + g_free(a); + g_free(mon); } void client_find_move_directional(ObClient *self, ObDirection dir, @@ -4119,7 +4121,7 @@ void client_find_resize_directional(ObClient *self, ObDirection side, *h -= self->frame->size.top + self->frame->size.bottom; } -ObClient* client_under_pointer() +ObClient* client_under_pointer(void) { gint x, y; GList *it; diff --git a/openbox/client_list_combined_menu.c b/openbox/client_list_combined_menu.c index bb492190..194c927e 100644 --- a/openbox/client_list_combined_menu.c +++ b/openbox/client_list_combined_menu.c @@ -82,8 +82,6 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data) } if (empty || onlyiconic) { - ObMenuEntry *e; - /* no entries or only iconified windows, so add a * way to go to this desktop without uniconifying a window */ if (!empty) diff --git a/openbox/client_list_menu.c b/openbox/client_list_menu.c index 5f6a832d..33f4b6f5 100644 --- a/openbox/client_list_menu.c +++ b/openbox/client_list_menu.c @@ -137,10 +137,10 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data) for (i = 0; i < screen_num_desktops; ++i) { ObMenu *submenu; gchar *name = g_strdup_printf("%s-%u", MENU_NAME, i); - DesktopData *data = g_new(DesktopData, 1); + DesktopData *ddata = g_new(DesktopData, 1); - data->desktop = i; - submenu = menu_new(name, screen_desktop_names[i], FALSE, data); + ddata->desktop = i; + submenu = menu_new(name, screen_desktop_names[i], FALSE, ddata); menu_set_update_func(submenu, desk_menu_update); menu_set_execute_func(submenu, desk_menu_execute); menu_set_destroy_func(submenu, desk_menu_destroy); diff --git a/openbox/client_menu.c b/openbox/client_menu.c index 203d93ac..cf556744 100644 --- a/openbox/client_menu.c +++ b/openbox/client_menu.c @@ -352,7 +352,7 @@ static void client_menu_place(ObMenuFrame *frame, gint *x, gint *y, } } -void client_menu_startup() +void client_menu_startup(void) { ObMenu *menu; ObMenuEntry *e; diff --git a/openbox/config.c b/openbox/config.c index 2bdd1966..ff4c542b 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -96,7 +96,7 @@ gint config_resist_edge; GSList *config_per_app_settings; -ObAppSettings* config_create_app_settings() +ObAppSettings* config_create_app_settings(void) { ObAppSettings *settings = g_new0(ObAppSettings, 1); settings->decor = -1; @@ -174,8 +174,8 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src, the monitor, so <position><x>center</x></position><monitor>2</monitor> will center the window on the second monitor. */ -static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node, gpointer d) +static void parse_per_app_settings(ObParseInst *inst, xmlDocPtr doc, + xmlNodePtr node, gpointer data) { xmlNodePtr app = parse_find_node("application", node->children); gchar *name = NULL, *class = NULL, *role = NULL; @@ -320,14 +320,14 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc, config_per_app_settings = g_slist_append(config_per_app_settings, (gpointer) settings); + g_free(name); + g_free(class); + g_free(role); + name = class = role = NULL; } app = parse_find_node("application", app->next); } - - g_free(name); - g_free(class); - g_free(role); } /* @@ -379,7 +379,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; gchar *key; @@ -411,7 +411,7 @@ static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, */ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n, nbut, nact; gchar *buttonstr; @@ -468,7 +468,7 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -489,7 +489,7 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -503,7 +503,7 @@ static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_margins(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -520,7 +520,7 @@ static void parse_margins(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -603,7 +603,7 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -640,7 +640,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -667,7 +667,7 @@ static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -744,7 +744,7 @@ static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; for (node = node->children; node; node = node->next) { @@ -768,7 +768,7 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, } static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer d) + gpointer data) { xmlNodePtr n; @@ -785,7 +785,7 @@ typedef struct const gchar *actname; } ObDefKeyBind; -static void bind_default_keyboard() +static void bind_default_keyboard(void) { ObDefKeyBind *it; ObDefKeyBind binds[] = { @@ -808,7 +808,7 @@ typedef struct const gchar *actname; } ObDefMouseBind; -static void bind_default_mouse() +static void bind_default_mouse(void) { ObDefMouseBind *it; ObDefMouseBind binds[] = { @@ -962,7 +962,7 @@ void config_startup(ObParseInst *i) parse_register(i, "applications", parse_per_app_settings, NULL); } -void config_shutdown() +void config_shutdown(void) { GSList *it; diff --git a/openbox/dock.c b/openbox/dock.c index 3b32758a..9d4b56c4 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -189,7 +189,7 @@ void dock_add(Window win, XWMHints *wmhints) ob_debug("Managed Dock App: 0x%lx (%s)\n", app->icon_win, app->class); } -void dock_remove_all() +void dock_remove_all(void) { while (dock->dock_apps) dock_remove(dock->dock_apps->data, TRUE); @@ -219,7 +219,7 @@ void dock_remove(ObDockApp *app, gboolean reparent) g_free(app); } -void dock_configure() +void dock_configure(void) { GList *it; gint hspot, vspot; diff --git a/openbox/event.c b/openbox/event.c index 9c47c04a..5e44bc9f 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -718,6 +718,8 @@ static void event_handle_root(XEvent *e) ob_reconfigure(); else if (e->xclient.data.l[0] == 2) ob_restart(); + else if (e->xclient.data.l[0] == 3) + ob_exit(0); } break; case PropertyNotify: @@ -1579,7 +1581,7 @@ static void event_handle_dockapp(ObDockApp *app, XEvent *e) } } -static ObMenuFrame* find_active_menu() +static ObMenuFrame* find_active_menu(void) { GList *it; ObMenuFrame *ret = NULL; @@ -1593,7 +1595,7 @@ static ObMenuFrame* find_active_menu() return ret; } -static ObMenuFrame* find_active_or_last_menu() +static ObMenuFrame* find_active_or_last_menu(void) { ObMenuFrame *ret = NULL; @@ -1857,12 +1859,14 @@ static void focus_delay_client_dest(ObClient *client, gpointer data) client, FALSE); } -void event_halt_focus_delay() +void event_halt_focus_delay(void) { + /* ignore all enter events up till now */ + event_end_ignore_all_enters(1); ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func); } -gulong event_start_ignore_all_enters() +gulong event_start_ignore_all_enters(void) { XSync(ob_display, FALSE); return LastKnownRequestProcessed(ob_display); @@ -1909,7 +1913,7 @@ static gboolean is_enter_focus_event_ignored(XEvent *e) return FALSE; } -void event_cancel_all_key_grabs() +void event_cancel_all_key_grabs(void) { if (actions_interactive_act_running()) { actions_interactive_cancel_act(); @@ -1956,7 +1960,7 @@ gboolean event_time_after(Time t1, Time t2) return t1 >= t2 && t1 < (t2 + TIME_HALF); } -Time event_get_server_time() +Time event_get_server_time(void) { /* Generate a timestamp */ XEvent event; diff --git a/openbox/extensions.c b/openbox/extensions.c index 89a96576..ee73e9ec 100644 --- a/openbox/extensions.c +++ b/openbox/extensions.c @@ -34,7 +34,7 @@ gint extensions_randr_event_basep; gboolean extensions_sync = FALSE; gint extensions_sync_event_basep; -void extensions_query_all() +void extensions_query_all(void) { gint junk; (void)junk; diff --git a/openbox/focus.c b/openbox/focus.c index b056db7e..df02cb76 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -178,7 +178,7 @@ ObClient* focus_fallback(gboolean allow_refocus, gboolean allow_pointer, return new; } -void focus_nothing() +void focus_nothing(void) { /* Install our own colormap */ if (focus_client != NULL) { diff --git a/openbox/focus_cycle_indicator.h b/openbox/focus_cycle_indicator.h index 8c84f71a..28175c75 100644 --- a/openbox/focus_cycle_indicator.h +++ b/openbox/focus_cycle_indicator.h @@ -27,6 +27,4 @@ void focus_cycle_indicator_shutdown(gboolean reconfig); void focus_cycle_draw_indicator(struct _ObClient *c); -void focus_cycle_stop(); - #endif diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index e0a8080f..488ecce1 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -96,7 +96,7 @@ void focus_cycle_popup_startup(gboolean reconfig) { XSetWindowAttributes attrib; - single_popup = icon_popup_new(TRUE); + single_popup = icon_popup_new(); popup.obwin.type = Window_Internal; popup.a_bg = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg); @@ -456,10 +456,11 @@ void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows, XMapWindow(ob_display, popup.bg); XFlush(ob_display); popup.mapped = TRUE; + screen_hide_desktop_popup(); } } -void focus_cycle_popup_hide() +void focus_cycle_popup_hide(void) { gulong ignore_start; @@ -519,9 +520,10 @@ void focus_cycle_popup_single_show(struct _ObClient *c, text = popup_get_name(c); icon_popup_show(single_popup, text, client_icon(c, ICON_SIZE, ICON_SIZE)); g_free(text); + screen_hide_desktop_popup(); } -void focus_cycle_popup_single_hide() +void focus_cycle_popup_single_hide(void) { icon_popup_hide(single_popup); } diff --git a/openbox/grab.c b/openbox/grab.c index 3fa45b7c..43e9a815 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -41,7 +41,7 @@ static guint pgrabs = 0; static Time grab_time = CurrentTime; static gint passive_count = 0; -static Time ungrab_time() +static Time ungrab_time(void) { Time t = event_curtime; if (grab_time == CurrentTime || @@ -58,12 +58,12 @@ static Time ungrab_time() return t; } -gboolean grab_on_keyboard() +gboolean grab_on_keyboard(void) { return kgrabs > 0; } -gboolean grab_on_pointer() +gboolean grab_on_pointer(void) { return pgrabs > 0; } @@ -218,7 +218,7 @@ void grab_key_passive_count(int change) if (passive_count < 0) passive_count = 0; } -void ungrab_passive_key() +void ungrab_passive_key(void) { /*ob_debug("ungrabbing %d passive grabs\n", passive_count);*/ if (passive_count) { diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 6e45e5c4..0aade9ab 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -115,7 +115,7 @@ void keyboard_reset_chains(gint break_chroots) set_curpos(p); } -void keyboard_unbind_all() +void keyboard_unbind_all(void) { tree_destroy(keyboard_firstnode); keyboard_firstnode = NULL; @@ -267,7 +267,7 @@ void keyboard_event(ObClient *client, const XEvent *e) void keyboard_startup(gboolean reconfig) { grab_keys(TRUE); - popup = popup_new(FALSE); + popup = popup_new(); popup_set_text_align(popup, RR_JUSTIFY_CENTER); } diff --git a/openbox/mainloop.c b/openbox/mainloop.c index 591a7159..7c6a9566 100644 --- a/openbox/mainloop.c +++ b/openbox/mainloop.c @@ -216,8 +216,6 @@ void ob_main_loop_destroy(ObMainLoop *loop) /* only do this if we're the last loop destroyed */ if (!all_loops) { - guint i; - /* grab all the signals that cause core dumps */ for (i = 0; i < NUM_CORE_SIGNALS; ++i) { if (all_signals[core_signals[i]].installed) { diff --git a/openbox/menu.c b/openbox/menu.c index b69b7a3b..d9426e90 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -147,7 +147,7 @@ static void clear_cache(gpointer key, gpointer val, gpointer data) menu_clear_entries(menu); } -void menu_clear_pipe_caches() +void menu_clear_pipe_caches(void) { /* delete any pipe menus' submenus */ g_hash_table_foreach_remove(menu_hash, menu_pipe_submenu, NULL); @@ -370,13 +370,6 @@ ObMenu* menu_new(const gchar *name, const gchar *title, self->more_menu->data = data; self->more_menu->shortcut = g_unichar_tolower(g_utf8_get_char("M")); - self->more_menu->show_func = self->show_func; - self->more_menu->hide_func = self->hide_func; - self->more_menu->update_func = self->update_func; - self->more_menu->execute_func = self->execute_func; - self->more_menu->destroy_func = self->destroy_func; - self->more_menu->place_func = self->place_func; - return self; } @@ -472,7 +465,7 @@ void menu_show(gchar *name, gint x, gint y, gboolean mouse, ObClient *client) } } -gboolean menu_hide_delay_reached() +gboolean menu_hide_delay_reached(void) { return menu_can_hide; } @@ -523,6 +516,7 @@ void menu_entry_unref(ObMenuEntry *self) g_free(self->data.submenu.name); break; case OB_MENU_ENTRY_TYPE_SEPARATOR: + g_free(self->data.separator.label); break; } @@ -612,19 +606,16 @@ ObMenuEntry* menu_add_separator(ObMenu *self, gint id, const gchar *label) void menu_set_show_func(ObMenu *self, ObMenuShowFunc func) { self->show_func = func; - self->more_menu->show_func = func; /* keep it in sync */ } void menu_set_hide_func(ObMenu *self, ObMenuHideFunc func) { self->hide_func = func; - self->more_menu->hide_func = func; /* keep it in sync */ } void menu_set_update_func(ObMenu *self, ObMenuUpdateFunc func) { self->update_func = func; - self->more_menu->update_func = func; /* keep it in sync */ } void menu_set_execute_func(ObMenu *self, ObMenuExecuteFunc func) @@ -636,13 +627,11 @@ void menu_set_execute_func(ObMenu *self, ObMenuExecuteFunc func) void menu_set_destroy_func(ObMenu *self, ObMenuDestroyFunc func) { self->destroy_func = func; - self->more_menu->destroy_func = func; /* keep it in sync */ } void menu_set_place_func(ObMenu *self, ObMenuPlaceFunc func) { self->place_func = func; - self->more_menu->place_func = func; /* keep it in sync */ } ObMenuEntry* menu_find_entry_id(ObMenu *self, gint id) diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 2c666e3f..979e834f 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -637,9 +637,9 @@ void menu_frame_render(ObMenuFrame *self) STRUT_SET(self->item_margin, 0, 0, 0, 0); if (self->entries) { - ObMenuEntryFrame *e = self->entries->data; gint l, t, r, b; + e = self->entries->data; e->a_text_normal->texture[0].data.text.string = ""; tw = RrMinWidth(e->a_text_normal); tw += 2*PADDING; @@ -1057,7 +1057,7 @@ static void menu_frame_hide(ObMenuFrame *self) menu_frame_free(self); } -void menu_frame_hide_all() +void menu_frame_hide_all(void) { GList *it; diff --git a/openbox/mouse.c b/openbox/mouse.c index 97616096..66615585 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -142,7 +142,7 @@ static void grab_all_clients(gboolean grab) mouse_grab_for_client(it->data, grab); } -void mouse_unbind_all() +void mouse_unbind_all(void) { gint i; GSList *it; @@ -153,10 +153,10 @@ void mouse_unbind_all() gint j; for (j = 0; j < OB_NUM_MOUSE_ACTIONS; ++j) { - GSList *it; + GSList *jt; - for (it = b->actions[j]; it; it = g_slist_next(it)) - actions_act_unref(it->data); + for (jt = b->actions[j]; jt; jt = g_slist_next(jt)) + actions_act_unref(jt->data); g_slist_free(b->actions[j]); } g_free(b); diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 1a8550a9..bb17d4a0 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -77,7 +77,7 @@ static void client_dest(ObClient *client, gpointer data) void moveresize_startup(gboolean reconfig) { - popup = popup_new(FALSE); + popup = popup_new(); popup_set_text_align(popup, RR_JUSTIFY_CENTER); if (!reconfig) @@ -299,7 +299,7 @@ static void do_move(gboolean keyboard, gint keydist) } -static void do_resize() +static void do_resize(void) { gint x, y, w, h, lw, lh; @@ -538,7 +538,7 @@ static void do_edge_warp(gint x, gint y) } } -static void cancel_edge_warp() +static void cancel_edge_warp(void) { ob_main_loop_timeout_remove(ob_main_loop, edge_warp_delay_func); } diff --git a/openbox/openbox.c b/openbox/openbox.c index 06afffc8..6f47fbd0 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -489,6 +489,7 @@ static void print_help() g_print(_("\nPassing messages to a running Openbox instance:\n")); g_print(_(" --reconfigure Reload Openbox's configuration\n")); g_print(_(" --restart Restart Openbox\n")); + g_print(_(" --exit Exit Openbox\n")); g_print(_("\nDebugging options:\n")); g_print(_(" --sync Run in synchronous mode\n")); g_print(_(" --debug Display debugging output\n")); @@ -511,7 +512,7 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num) static void parse_env() { /* unset this so we don't pass it on unknowingly */ - unsetenv("DESKTOP_STARTUP_ID"); + putenv("DESKTOP_STARTUP_ID"); } static void parse_args(gint *argc, gchar **argv) @@ -554,9 +555,13 @@ static void parse_args(gint *argc, gchar **argv) } else if (!strcmp(argv[i], "--reconfigure")) { remote_control = 1; - } else if (!strcmp(argv[i], "--restart")) { + } + else if (!strcmp(argv[i], "--restart")) { remote_control = 2; } + else if (!strcmp(argv[i], "--exit")) { + remote_control = 3; + } else if (!strcmp(argv[i], "--sm-save-file")) { if (i == *argc - 1) /* no args left */ /* not translated cuz it's sekret */ diff --git a/openbox/place.c b/openbox/place.c index 7c20c79f..aa572db2 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -134,6 +134,8 @@ static Rect **pick_head(ObClient *c) for (i = 0; i < screen_num_monitors; ++i) area[i] = screen_area(c->desktop, choice[i], NULL); + g_free(choice); + return area; } @@ -180,7 +182,7 @@ static GSList* area_remove(GSList *list, Rect *a) if (!RECT_INTERSECTS_RECT(*r, *a)) { result = g_slist_prepend(result, r); - r = NULL; /* dont free it */ + /* dont free r, it's moved to the result list */ } else { Rect isect, extra; @@ -215,9 +217,10 @@ static GSList* area_remove(GSList *list, Rect *a) r->width, RECT_BOTTOM(*r) - RECT_BOTTOM(isect)); result = area_add(result, &extra); } - } - g_free(r); + /* 'r' is not being added to the result list, so free it */ + g_free(r); + } } g_slist_free(list); return result; @@ -251,8 +254,6 @@ static gboolean place_nooverlap(ObClient *c, gint *x, gint *y) /* try ignoring different things to find empty space */ for (ignore = 0; ignore < IGNORE_END && !ret; ignore++) { - guint i; - /* try all monitors in order of preference */ for (i = 0; i < screen_num_monitors && !ret; ++i) { GList *it; diff --git a/openbox/popup.c b/openbox/popup.c index d49148ff..071f5b62 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -29,7 +29,7 @@ #include "render/render.h" #include "render/theme.h" -ObPopup *popup_new() +ObPopup *popup_new(void) { XSetWindowAttributes attrib; ObPopup *self = g_new0(ObPopup, 1); @@ -151,14 +151,12 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) { gint l, t, r, b; gint x, y, w, h; + guint m; gint emptyx, emptyy; /* empty space between elements */ gint textx, texty, textw, texth; gint iconx, icony, iconw, iconh; Rect *area, mon; - RECT_SET(mon, self->x, self->y, 1, 1); - area = screen_physical_area_monitor(screen_find_monitor(&mon)); - /* when there is no icon and the text is not parent relative, then fill the whole dialog with the text appearance, don't use the bg at all */ @@ -246,8 +244,27 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) break; } - x=MAX(MIN(x, area->width-w),0); - y=MAX(MIN(y, area->height-h),0); + /* Find the monitor which contains the biggest part of the popup. + * If the popup is completely off screen, limit it to the intersection + * of all monitors and then try again. If it's still off screen, put it + * on monitor 0. */ + RECT_SET(mon, x, y, w, h); + m = screen_find_monitor(&mon); + area = screen_physical_area_monitor(m); + + x=MAX(MIN(x, area->x+area->width-w),area->x); + y=MAX(MIN(y, area->y+area->height-h),area->y); + + if (m == screen_num_monitors) { + RECT_SET(mon, x, y, w, h); + m = screen_find_monitor(&mon); + if (m == screen_num_monitors) + m = 0; + area = screen_physical_area_monitor(m); + + x=MAX(MIN(x, area->x+area->width-w),area->x); + y=MAX(MIN(y, area->y+area->height-h),area->y); + } /* set the windows/appearances up */ XMoveResizeWindow(ob_display, self->bg, x, y, w, h); @@ -315,12 +332,12 @@ static void icon_popup_draw_icon(gint x, gint y, gint w, gint h, gpointer data) RrPaint(self->a_icon, self->icon, w, h); } -ObIconPopup *icon_popup_new() +ObIconPopup *icon_popup_new(void) { ObIconPopup *self; self = g_new0(ObIconPopup, 1); - self->popup = popup_new(TRUE); + self->popup = popup_new(); self->a_icon = RrAppearanceCopy(ob_rr_theme->a_clear_tex); self->icon = XCreateWindow(ob_display, self->popup->bg, 0, 0, 1, 1, 0, @@ -473,12 +490,12 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h, } } -ObPagerPopup *pager_popup_new() +ObPagerPopup *pager_popup_new(void) { ObPagerPopup *self; self = g_new(ObPagerPopup, 1); - self->popup = popup_new(TRUE); + self->popup = popup_new(); self->desks = 0; self->wins = g_new(Window, self->desks); diff --git a/openbox/prop.c b/openbox/prop.c index 40ae6ef2..44abdfe6 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -27,7 +27,7 @@ Atoms prop_atoms; #define CREATE(var, name) (prop_atoms.var = \ XInternAtom(ob_display, name, FALSE)) -void prop_startup() +void prop_startup(void) { CREATE(cardinal, "CARDINAL"); CREATE(window, "WINDOW"); diff --git a/openbox/screen.c b/openbox/screen.c index 93ec57f5..a8da15c0 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -52,9 +52,9 @@ ButtonPressMask | ButtonReleaseMask) static gboolean screen_validate_layout(ObDesktopLayout *l); -static gboolean replace_wm(); -static void screen_tell_ksplash(); -static void screen_fallback_focus(); +static gboolean replace_wm(void); +static void screen_tell_ksplash(void); +static void screen_fallback_focus(void); guint screen_num_desktops; guint screen_num_monitors; @@ -77,7 +77,7 @@ static GSList *struts_bottom = NULL; static ObPagerPopup *desktop_popup; -static gboolean replace_wm() +static gboolean replace_wm(void) { gchar *wm_sn; Atom wm_sn_atom; @@ -149,7 +149,7 @@ static gboolean replace_wm() return TRUE; } -gboolean screen_annex() +gboolean screen_annex(void) { XSetWindowAttributes attrib; pid_t pid; @@ -304,7 +304,7 @@ gboolean screen_annex() return TRUE; } -static void screen_tell_ksplash() +static void screen_tell_ksplash(void) { XEvent e; char **argv; @@ -344,7 +344,7 @@ void screen_startup(gboolean reconfig) guint32 d; gboolean namesexist = FALSE; - desktop_popup = pager_popup_new(FALSE); + desktop_popup = pager_popup_new(); pager_popup_height(desktop_popup, POPUP_HEIGHT); if (reconfig) { @@ -453,7 +453,7 @@ void screen_shutdown(gboolean reconfig) screen_desktop_names = NULL; } -void screen_resize() +void screen_resize(void) { static gint oldw = 0, oldh = 0; gint w, h; @@ -536,7 +536,7 @@ void screen_set_num_desktops(guint num) screen_set_desktop(num - 1, TRUE); } -static void screen_fallback_focus() +static void screen_fallback_focus(void) { ObClient *c; gboolean allow_omni; @@ -855,6 +855,13 @@ void screen_show_desktop_popup(guint d) ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func); ob_main_loop_timeout_add(ob_main_loop, config_desktop_popup_time * 1000, hide_desktop_popup_func, NULL, NULL, NULL); + g_free(a); +} + +void screen_hide_desktop_popup(void) +{ + ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func); + pager_popup_hide(desktop_popup); } guint screen_find_desktop(guint from, ObDirection dir, @@ -1000,7 +1007,7 @@ static gboolean screen_validate_layout(ObDesktopLayout *l) return TRUE; } -void screen_update_layout() +void screen_update_layout(void) { ObDesktopLayout l; @@ -1049,7 +1056,7 @@ void screen_update_layout() } } -void screen_update_desktop_names() +void screen_update_desktop_names(void) { guint i; @@ -1211,7 +1218,7 @@ typedef struct { } \ } -void screen_update_areas() +void screen_update_areas(void) { guint i, j; gulong *dims; @@ -1503,7 +1510,7 @@ Rect* screen_area(guint desktop, guint head, Rect *search) guint screen_find_monitor(Rect *search) { guint i; - guint most = 0; + guint most = screen_num_monitors; guint mostv = 0; for (i = 0; i < screen_num_monitors; ++i) { @@ -1525,7 +1532,7 @@ guint screen_find_monitor(Rect *search) return most; } -Rect* screen_physical_area_all_monitors() +Rect* screen_physical_area_all_monitors(void) { return screen_physical_area_monitor(screen_num_monitors); } @@ -1547,7 +1554,7 @@ gboolean screen_physical_area_monitor_contains(guint head, Rect *search) return RECT_INTERSECTS_RECT(monitor_area[head], *search); } -Rect* screen_physical_area_active() +Rect* screen_physical_area_active(void) { Rect *a; gint x, y; @@ -1567,7 +1574,7 @@ Rect* screen_physical_area_active() return a; } -void screen_set_root_cursor() +void screen_set_root_cursor(void) { if (sn_app_starting()) XDefineCursor(ob_display, RootWindow(ob_display, ob_screen), diff --git a/openbox/screen.h b/openbox/screen.h index 68a13251..39871e33 100644 --- a/openbox/screen.h +++ b/openbox/screen.h @@ -77,6 +77,8 @@ guint screen_find_desktop(guint from, ObDirection dir, /*! Show the desktop popup/notification */ void screen_show_desktop_popup(guint d); +/*! Hide it */ +void screen_hide_desktop_popup(); /*! Shows and focuses the desktop and hides all the client windows, or returns to the normal state, showing client windows. diff --git a/openbox/stacking.c b/openbox/stacking.c index 2280b877..b23e6eac 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -29,7 +29,7 @@ GList *stacking_list = NULL; -void stacking_set_list() +void stacking_set_list(void) { Window *windows = NULL; GList *it; @@ -411,6 +411,7 @@ void stacking_add_nonintrusive(ObWindow *win) ObClient *client; GList *it_below = NULL; /* this client will be below us */ GList *it_above; + GList *wins; if (!WINDOW_IS_CLIENT(win)) { stacking_add(win); /* no special rules for others */ @@ -468,7 +469,7 @@ void stacking_add_nonintrusive(ObWindow *win) break; } - GList *wins = g_list_append(NULL, win); + wins = g_list_append(NULL, win); do_restack(wins, it_below); g_list_free(wins); } diff --git a/openbox/startupnotify.c b/openbox/startupnotify.c index 1cf8da6f..4c929e7e 100644 --- a/openbox/startupnotify.c +++ b/openbox/startupnotify.c @@ -61,7 +61,7 @@ void sn_startup(gboolean reconfig) if (reconfig) return; /* unset this so we don't pass it on unknowingly */ - unsetenv("DESKTOP_STARTUP_ID"); + putenv("DESKTOP_STARTUP_ID"); sn_display = sn_display_new(ob_display, NULL, NULL); sn_context = sn_monitor_context_new(sn_display, ob_screen, @@ -106,7 +106,7 @@ static SnStartupSequence* sequence_find(const gchar *id) return ret; } -gboolean sn_app_starting() +gboolean sn_app_starting(void) { return sn_waits != NULL; } @@ -259,12 +259,12 @@ void sn_setup_spawn_environment(gchar *program, gchar *name, g_direct_equal, (GDestroyNotify)sn_launcher_context_unref); - setenv("DESKTOP_STARTUP_ID", id, TRUE); + putenv(g_strdup_printf("DESKTOP_STARTUP_ID=%s", id)); g_free(desc); } -void sn_spawn_cancel() +void sn_spawn_cancel(void) { sn_launcher_context_complete(sn_launcher); } diff --git a/openbox/translate.c b/openbox/translate.c index 5b2b4ebe..21015578 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -156,7 +156,7 @@ translation_fail: return ret; } -const gchar *translate_keycode(guint keycode) +gchar *translate_keycode(guint keycode) { KeySym sym; const gchar *ret = NULL; @@ -170,7 +170,7 @@ gunichar translate_unichar(guint keycode) { gunichar unikey = 0; - const char *key; + char *key; if ((key = translate_keycode(keycode)) != NULL && /* don't accept keys that aren't a single letter, like "space" */ key[1] == '\0') @@ -179,5 +179,6 @@ gunichar translate_unichar(guint keycode) if (unikey == (gunichar)-1 || unikey == (gunichar)-2 || unikey == 0) unikey = 0; } + g_free(key); return unikey; } diff --git a/openbox/translate.h b/openbox/translate.h index 21cd6498..6d9e23bc 100644 --- a/openbox/translate.h +++ b/openbox/translate.h @@ -25,7 +25,7 @@ gboolean translate_button(const gchar *str, guint *state, guint *keycode); gboolean translate_key(const gchar *str, guint *state, guint *keycode); /*! Give the string form of a keycode */ -const gchar *translate_keycode(guint keycode); +gchar *translate_keycode(guint keycode); /*! Translate a keycode to the unicode character it represents */ gunichar translate_unichar(guint keycode); |
