From: Dana Jansens Date: Sun, 2 Mar 2008 23:11:45 +0000 (-0500) Subject: Merge branch 'backport' into 3.4-working X-Git-Tag: release-3.4.7-pre2^0 X-Git-Url: http://git.openbox.org/?p=mikachu%2Fopenbox.git;a=commitdiff_plain;h=3337bbcb9d776be204d7b2feee28a7e4308bf9ad;hp=5b4e483366080aa0a60524c63614e904dfc5ef84 Merge branch 'backport' into 3.4-working --- diff --git a/CHANGELOG b/CHANGELOG index fd68f09..29c1c70 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,156 @@ +3.4.7-pre2: + * Updated Czech, Chinese, Dutch, Swedish, Finnish, Spanish, Brasilian + Portuguese, Japanese and Portuguese translations + * Add an example of the "force" option for the per-app placement options to + the default rc.xml file + * Add a new xdg-autostart script. This will eventually end up in the PyXDG + distribution hopefully, but it is included in Openbox for now. This script + runs things based on the freedesktop.org autostart specification. You can + have it run GNOME, KDE, ROX, or XFCE specific things if you want. The + new default system-wide autostart.sh script runs it automatically + * Update the default menu.xml to include a lot of common apps + * Fix white font shadows (negative shadowtint) + * Update the autostart.sh to find gnome-settings-daemon correctly, as the + GNOME people have moved it to libexec + * Fix focus possibly getting stolen when using the Focus action + * Drastically speed up rendering of Vertical and SplitVertical gradients + * Speed improvements also for Horizonal and Pyramid gradients + * Add new theme options, menu.overlap.x and menu.overlap.y options, that let + you independently control the horizontal and vertical position of submenus + * Change _NET_ACTIVE_WINDOW messages to not change the current desktop, but + to bring the window to the current desktop instead. This is the industry + standard policy + * Use the pretty new openbox.png icon as the default window icon + * Allow matching per-application rules to windows by their window type + (normal, dialog, splash, etc). The default rc.xml has more details + * Add new Openbox-themed prompt windows. Use these prompt windows to ask + before killing off windows that aren't responding. This also means we + don't need to ping every window constantly forever + * Add a new option to the Execute action. If this is set to a + string, a dialog will be shown with that string in it and "yes"/"no" + buttons. The command to be executed will only be run if the user selects + "yes" in the dialog + * Add a new option to the Exit action, which is a boolean (not a + string). When true, Openbox will show a dialog confirming if you want to + exit. The default is now to show the prompt + * Reduce Openbox's memory footprint and speed up rendering through the use + of a new icon cache, so that Openbox only needs to keep 1 copy of an icon + when 100 different windows share it + * Make Openbox menus have the "menu type" hint for compositors to see and use + * Fix actions so that key presses will not be lost between running the + ShowMenu action and the menu appearing + * Fix the MoveResizeTo action for negative coords (opposite edges) + * Fix key bindings getting lost if multiple bindings at the same level could + not be translated (Fixes VMWare causing Openbox keybindings to stop + working) + * Fix the resize popup box for terminal windows with a base size of 0 (show + the right size values for urxvt terminals) + * Fix some off-by-one bugs with the edge growing/shrinking code + * Add new theme options for menu line separators: menu.separator.color, + menu.separator.width, menu.separator.padding.width, + menu.separator.padding.height + * Add xfce-mcs-manager to the default autostart.sh, and run it automatically + when gnome-settings-daemon is not present to have GTK apps inherit settings + from the XFCE configuration tools + * Make the send-to-desktop menu in the client-menu indicate which is the current + desktop for omnipresent windows, and don't close it if just toggling + omni-presence when ctrl-clicking + * Add a new SessionLogout action that logs out through the session manager, + when running Openbox within a session manager such as within an + GNOME/Openbox or KDE/Openbox session. The action includes a + option which is similar to the Exit action's + * Add a new gdm-control command that lets you control gdm from within an X + session. The gdm-control lets you change GDM's behaviour for when you end + the current session. For instance, you can tell GDM to reboot, and + then immediately log out of the current session, and the computer will be + rebooted + * Show an information dialog when an error occurs for Openbox, such as when + the Execute action fails + * Show an information dialog when there are XML syntax errors in the Openbox + configuration files + +3.4.6.1: + * Updated Clearlooks theme + * Add the force="yes/no" option for the per-app settings' tag + * Raise and focus modal children and their direct parents together, improved + usability with direct modal transient windows + * Fix crash when using for NextWindow and there are no windows + to move focus to + * Add the option in the rc.xml section, which toggles + the "Manage Desktops" section appearing in the combined-client-list-menu + * Fix for menu headers showing the wrong text + * Fix for the behavior + * Treat modal direct children as one window with their parent consistently + +3.4.6: + * Added Basque translation + * Updated French, Vietnamese German, Simplified Chinese, Russian, Portuguese, + Brasilian Portuguese, Norwegian, and Finnish translations + * New Clearlooks theme, updated by David Barr + * Updated the previous Clearlooks theme, and renamed it to Clearlooks-3.4 + * Allow dialog type windows to go fullscreen (Fixes Kpdf) + * Remove the extraneous top border for undecorated windows while maximized + * Fixes for keyboard modifiers (Alt-tab dialog getting stuck on screen for + some users) + * Automatically catch changes to the keyboard map and reconfigure the key + bindings on the fly + * Fix focus moving incorrectly sometimes with focus under mouse enabled + * Make default configuration focus the desktop when you right click + * Add the and options for all window cycling actions, allowing + you to have your target window temporarily raised above all others, and to + turn the focus target indicator bar off + * Improve the LastDesktop action to not remember desktops you skipped across + * Ignore mouse clicks that are made on override-redirect (unmanaged) windows + * When opening a menu with a key binding, don't use the key binding to run + something in the menu + * Add a option for window placement, which gives you the option + to place new windows on the active monitor, or the monitor where the mouse + is, instead of on any monitor (for xinerama multihead setups) + * Add options for placing the window move/resize coordinate popup window in + a fixed position on screen, rather than relative to the window being + moved or resized + * Prevent the dock from auto-hiding completely offscreen if the theme has + no borders for it + * New icon + * Fix race condition when running things that want to grab the keyboard + (e.g. gnome-panel-control --main-menu) + * When dialog windows ask to not appear in the taskbar, still give them focus + in normal ways (fixes new GNOME session logout dialogs) + * Fix bug with resizing corners on certain parts of the window frame + * Ping applications to tell when they are running or have become frozen. + Show a [Not Responding] message in the title bar of windows which are + frozen. + * When closing a window which is [Not Responding], kill the window's process + if it is running on the same machine as Openbox. Otherwise, just + disconnect + the window from the X display. A second attempt to close a [Not + Responding] + window will kill it forcefully (kill -9). + * Fixes for internal timers + * Add a option for the execute action's startup-notification. This + lets you tell Openbox that the application will map a window with the + specified class - for applications that do not support startup-notification + natively. + * Fix for empty dock taking up space onscreen after a reconfigure + * Reduce Openbox's additional memory footprint per-window and per-menu + * Faster horizontal gradient rendering + * Don't deiconify windows that aren't allowed to be directly iconified on + restart (eg toolbars), as they can be iconified by other means + * Improve support for fullscreen windows in xinerama (TwinView) and + multiple-screen setups + * Add a --config-file command line option, to specify an alternate + configuration file path + +3.4.5: + * Added Hungarian translation + * Updated Finnish, Russian, German and French translations + * Fixed some very minor memory leaks + * Hide the desktop popup when showing the focus popup + * Fix a crash when trying to access the More... menu of + client-list-combined-menu + * Fix the coordinate popup only showing up on the first monitor in xinerama + * Add --exit to exit the currently running openbox instance + 3.4.4: * Updated Traditional Chinese translation * Updated Norwegian translation diff --git a/Makefile.am b/Makefile.am index 6a6f175..c8ae71d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -173,7 +173,6 @@ openbox_openbox_SOURCES = \ openbox/actions/fullscreen.c \ openbox/actions/growtoedge.c \ openbox/actions/iconify.c \ - openbox/actions/if.c \ openbox/actions/kill.c \ openbox/actions/layer.c \ openbox/actions/session.c \ @@ -191,6 +190,7 @@ openbox_openbox_SOURCES = \ openbox/actions/resizerelative.c \ openbox/actions/restart.c \ openbox/actions/shade.c \ + openbox/actions/shadelowerraise.c \ openbox/actions/showdesktop.c \ openbox/actions/showmenu.c \ openbox/actions/unfocus.c \ diff --git a/configure.ac b/configure.ac index 53e5001..a52dd12 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.54]) -AC_INIT([openbox], [3.999.0], [http://bugzilla.icculus.org]) +AC_INIT([openbox], [3.4.7-pre2], [http://bugzilla.icculus.org]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([openbox/openbox.c]) @@ -15,7 +15,7 @@ dnl if MAJOR or MINOR version changes, be sure to change AC_INIT above to match dnl OB_MAJOR_VERSION=3 OB_MINOR_VERSION=4 -OB_MICRO_VERSION=16 +OB_MICRO_VERSION=21 OB_INTERFACE_AGE=0 OB_BINARY_AGE=0 OB_VERSION=$OB_MAJOR_VERSION.$OB_MINOR_VERSION diff --git a/data/rc.xml b/data/rc.xml index ebe2f31..2b65b25 100644 --- a/data/rc.xml +++ b/data/rc.xml @@ -178,40 +178,40 @@ - leftno + nono - rightno + nono - upno + nono - downno + nono - leftno + nono - rightno + nono - upno + nono - downno + nono - 1 + 1 - 2 + 2 - 3 + 3 - 4 + 4 @@ -232,31 +232,14 @@ - - - - - - - + - - - - - - - + yesyes - - - - - @@ -310,22 +293,22 @@ - previous + - next + - previous + - next + - previous + - next + @@ -338,7 +321,7 @@ - + @@ -424,7 +407,7 @@ - bottomleft + @@ -434,7 +417,7 @@ - bottomright + @@ -445,7 +428,7 @@ - topleft + @@ -456,7 +439,7 @@ - topright + @@ -537,13 +520,13 @@ - + - vertical + - horizontal + @@ -559,24 +542,24 @@ - - previous + + - - next + + - - previous + + - - next + + - - previous + + - - next + + @@ -600,17 +583,17 @@ - - previous + + - - next + + - - previous + + - - next + + diff --git a/data/rc.xsd b/data/rc.xsd index de227ea..c51135b 100644 --- a/data/rc.xsd +++ b/data/rc.xsd @@ -3,8 +3,8 @@ - + - - - - + + + + + + + + + + + + + + + + - - + + + + - - + + + - - + + + + + + + + + + + - + + + - + + + + + + + + + + - + + + - - + + + + + @@ -347,6 +387,7 @@ + diff --git a/openbox/actions.h b/openbox/actions.h index 6db6f8d..fb9a6a8 100644 --- a/openbox/actions.h +++ b/openbox/actions.h @@ -81,7 +81,7 @@ void actions_act_unref(ObActionsAct *act); void actions_set_need_pointer_replay_before_move(gboolean replay); /*! Returns if a ReplayPointer is still needed. If it was called while running actions then this will be false */ -gboolean actions_get_need_pointer_replay_before_move(); +gboolean actions_get_need_pointer_replay_before_move(void); /*! Pass in a GSList of ObActionsAct's to be run. */ void actions_run_acts(GSList *acts, @@ -93,8 +93,8 @@ void actions_run_acts(GSList *acts, ObFrameContext con, struct _ObClient *client); -gboolean actions_interactive_act_running(); -void actions_interactive_cancel_act(); +gboolean actions_interactive_act_running(void); +void actions_interactive_cancel_act(void); gboolean actions_interactive_input_event(XEvent *e); diff --git a/openbox/actions/addremovedesktop.c b/openbox/actions/addremovedesktop.c index 8125b9b..2b90d08 100644 --- a/openbox/actions/addremovedesktop.c +++ b/openbox/actions/addremovedesktop.c @@ -11,6 +11,14 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static gpointer setup_add_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static gpointer setup_remove_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_addcurrent_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_addlast_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_removecurrent_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_removelast_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); @@ -26,6 +34,26 @@ void action_addremovedesktop_startup(void) free_func, run_func, NULL, NULL); + actions_register("AddDesktopLast", + setup_addlast_func, + free_func, + run_func, + NULL, NULL); + actions_register("RemoveDesktopLast", + setup_removelast_func, + free_func, + run_func, + NULL, NULL); + actions_register("AddDesktopCurrent", + setup_addcurrent_func, + free_func, + run_func, + NULL, NULL); + actions_register("RemoveDesktopCurrent", + setup_removecurrent_func, + free_func, + run_func, + NULL, NULL); } static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) @@ -62,6 +90,38 @@ static gpointer setup_remove_func(ObParseInst *i, return o; } +static gpointer setup_addcurrent_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_add_func(i, doc, node); + o->current = TRUE; + return o; +} + +static gpointer setup_addlast_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_add_func(i, doc, node); + o->current = FALSE; + return o; +} + +static gpointer setup_removecurrent_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_remove_func(i, doc, node); + o->current = TRUE; + return o; +} + +static gpointer setup_removelast_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_remove_func(i, doc, node); + o->current = FALSE; + return o; +} + static void free_func(gpointer options) { Options *o = options; diff --git a/openbox/actions/all.c b/openbox/actions/all.c index c86c428..5a89997 100644 --- a/openbox/actions/all.c +++ b/openbox/actions/all.c @@ -37,6 +37,6 @@ void action_all_startup(void) action_layer_startup(); action_movetoedge_startup(); action_growtoedge_startup(); - action_if_startup(); action_focustobottom_startup(); + action_shadelowerraise_startup(); } diff --git a/openbox/actions/all.h b/openbox/actions/all.h index 4fbd6ff..d6676a4 100644 --- a/openbox/actions/all.h +++ b/openbox/actions/all.h @@ -1,44 +1,44 @@ #ifndef __actions_all_h #define __actions_all_h -void action_all_startup(); +void action_all_startup(void); -void action_execute_startup(); -void action_debug_startup(); -void action_showmenu_startup(); -void action_showdesktop_startup(); -void action_reconfigure_startup(); -void action_exit_startup(); -void action_restart_startup(); -void action_session_startup(); -void action_cyclewindows_startup(); -void action_breakchroot_startup(); -void action_close_startup(); -void action_move_startup(); -void action_focus_startup(); -void action_raise_startup(); -void action_lower_startup(); -void action_raiselower_startup(); -void action_unfocus_startup(); -void action_iconify_startup(); -void action_fullscreen_startup(); -void action_maximize_startup(); -void action_moveresizeto_startup(); -void action_moverelative_startup(); -void action_shade_startup(); -void action_kill_startup(); -void action_omnipresent_startup(); -void action_directionalwindows_startup(); -void action_resize_startup(); -void action_decorations_startup(); -void action_desktop_startup(); -void action_resizerelative_startup(); -void action_addremovedesktop_startup(); -void action_dockautohide_startup(); -void action_layer_startup(); -void action_movetoedge_startup(); -void action_growtoedge_startup(); -void action_if_startup(); -void action_focustobottom_startup(); +void action_execute_startup(void); +void action_debug_startup(void); +void action_showmenu_startup(void); +void action_showdesktop_startup(void); +void action_reconfigure_startup(void); +void action_exit_startup(void); +void action_restart_startup(void); +void action_session_startup(void); +void action_cyclewindows_startup(void); +void action_breakchroot_startup(void); +void action_close_startup(void); +void action_move_startup(void); +void action_focus_startup(void); +void action_raise_startup(void); +void action_lower_startup(void); +void action_raiselower_startup(void); +void action_unfocus_startup(void); +void action_iconify_startup(void); +void action_fullscreen_startup(void); +void action_maximize_startup(void); +void action_moveresizeto_startup(void); +void action_moverelative_startup(void); +void action_shade_startup(void); +void action_kill_startup(void); +void action_omnipresent_startup(void); +void action_directionalwindows_startup(void); +void action_resize_startup(void); +void action_decorations_startup(void); +void action_desktop_startup(void); +void action_resizerelative_startup(void); +void action_addremovedesktop_startup(void); +void action_dockautohide_startup(void); +void action_layer_startup(void); +void action_movetoedge_startup(void); +void action_growtoedge_startup(void); +void action_focustobottom_startup(void); +void action_shadelowerraise_startup(void); #endif diff --git a/openbox/actions/cyclewindows.c b/openbox/actions/cyclewindows.c index cb341af..aa206a9 100644 --- a/openbox/actions/cyclewindows.c +++ b/openbox/actions/cyclewindows.c @@ -4,6 +4,7 @@ #include "openbox/event.h" #include "openbox/focus_cycle.h" #include "openbox/openbox.h" +#include "openbox/client.h" #include "gettext.h" typedef struct { diff --git a/openbox/actions/desktop.c b/openbox/actions/desktop.c index 142fec5..177fe10 100644 --- a/openbox/actions/desktop.c +++ b/openbox/actions/desktop.c @@ -26,93 +26,236 @@ typedef struct { gboolean follow; } Options; -static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node); -static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node); +static gpointer setup_go_last_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_last_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_go_abs_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_abs_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_go_next_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_next_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_go_prev_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_prev_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_go_left_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_left_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_go_right_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_right_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_go_up_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_up_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_go_down_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_send_down_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); void action_desktop_startup(void) { - actions_register("GoToDesktop", setup_go_func, g_free, run_func, - NULL, NULL); - actions_register("SendToDesktop", setup_send_func, g_free, run_func, - NULL, NULL); + actions_register("DesktopLast", setup_go_last_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktopLast", setup_send_last_func, g_free, + run_func, NULL, NULL); + actions_register("Desktop", setup_go_abs_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktop", setup_send_abs_func, g_free, + run_func, NULL, NULL); + actions_register("DesktopNext", setup_go_next_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktopNext", setup_send_next_func, g_free, + run_func, NULL, NULL); + actions_register("DesktopPrevious", setup_go_prev_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktopPrevious", setup_send_prev_func, g_free, + run_func, NULL, NULL); + actions_register("DesktopLeft", setup_go_left_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktopLeft", setup_send_left_func, g_free, + run_func, NULL, NULL); + actions_register("DesktopRight", setup_go_right_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktopRight", setup_send_right_func, g_free, + run_func, NULL, NULL); + actions_register("DesktopUp", setup_go_up_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktopUp", setup_send_up_func, g_free, + run_func, NULL, NULL); + actions_register("DesktopDown", setup_go_down_func, g_free, + run_func, NULL, NULL); + actions_register("SendToDesktopDown", setup_send_down_func, g_free, + run_func, NULL, NULL); } -static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node) +static gpointer setup_follow(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) { xmlNodePtr n; - Options *o; + Options *o = g_new0(Options, 1); + o->send = TRUE; + o->follow = TRUE; + if ((n = parse_find_node("follow", node))) + o->follow = parse_bool(doc, n); + return o; +} - o = g_new0(Options, 1); - /* don't go anywhere if theres no options given */ +static gpointer setup_go_last_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->type = LAST; + return o; +} + +static gpointer setup_send_last_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = setup_follow(i, doc, node); + o->type = LAST; + return o; +} + +static gpointer setup_go_abs_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + xmlNodePtr n; + Options *o = g_new0(Options, 1); o->type = ABSOLUTE; - o->abs.desktop = screen_desktop; - /* wrap by default - it's handy! */ - o->rel.wrap = TRUE; + if ((n = parse_find_node("desktop", node))) + o->abs.desktop = parse_int(doc, n) - 1; + else + o->abs.desktop = screen_desktop; + return o; +} - if ((n = parse_find_node("to", node))) { - gchar *s = parse_string(doc, n); - if (!g_ascii_strcasecmp(s, "last")) - o->type = LAST; - else if (!g_ascii_strcasecmp(s, "next")) { - o->type = RELATIVE; - o->rel.linear = TRUE; - o->rel.dir = OB_DIRECTION_EAST; - } - else if (!g_ascii_strcasecmp(s, "previous")) { - o->type = RELATIVE; - o->rel.linear = TRUE; - o->rel.dir = OB_DIRECTION_WEST; - } - else if (!g_ascii_strcasecmp(s, "north") || - !g_ascii_strcasecmp(s, "up")) { - o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_NORTH; - } - else if (!g_ascii_strcasecmp(s, "south") || - !g_ascii_strcasecmp(s, "down")) { - o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_SOUTH; - } - else if (!g_ascii_strcasecmp(s, "west") || - !g_ascii_strcasecmp(s, "left")) { - o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_WEST; - } - else if (!g_ascii_strcasecmp(s, "east") || - !g_ascii_strcasecmp(s, "right")) { - o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_EAST; - } - else { - o->type = ABSOLUTE; - o->abs.desktop = atoi(s) - 1; - } - g_free(s); - } +static gpointer setup_send_abs_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + xmlNodePtr n; + Options *o = setup_follow(i, doc, node); + o->type = ABSOLUTE; + if ((n = parse_find_node("desktop", node))) + o->abs.desktop = parse_int(doc, n) - 1; + else + o->abs.desktop = screen_desktop; + return o; +} + +static void setup_rel(Options *o, ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node, gboolean lin, ObDirection dir) +{ + xmlNodePtr n; + + o->type = RELATIVE; + o->rel.linear = lin; + o->rel.dir = dir; + o->rel.wrap = TRUE; if ((n = parse_find_node("wrap", node))) o->rel.wrap = parse_bool(doc, n); +} +static gpointer setup_go_next_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + setup_rel(o, i, doc, node, TRUE, OB_DIRECTION_EAST); return o; } -static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node) +static gpointer setup_send_next_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) { - xmlNodePtr n; - Options *o; + Options *o = setup_follow(i, doc, node); + setup_rel(o, i, doc, node, TRUE, OB_DIRECTION_EAST); + return o; +} - o = setup_go_func(i, doc, node); - o->send = TRUE; - o->follow = TRUE; +static gpointer setup_go_prev_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + setup_rel(o, i, doc, node, TRUE, OB_DIRECTION_WEST); + return o; +} - if ((n = parse_find_node("follow", node))) - o->follow = parse_bool(doc, n); +static gpointer setup_send_prev_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = setup_follow(i, doc, node); + setup_rel(o, i, doc, node, TRUE, OB_DIRECTION_WEST); + return o; +} + +static gpointer setup_go_left_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_WEST); + return o; +} + +static gpointer setup_send_left_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = setup_follow(i, doc, node); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_WEST); + return o; +} + +static gpointer setup_go_right_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_EAST); + return o; +} + +static gpointer setup_send_right_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = setup_follow(i, doc, node); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_EAST); + return o; +} + +static gpointer setup_go_up_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_NORTH); + return o; +} + +static gpointer setup_send_up_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = setup_follow(i, doc, node); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_NORTH); + return o; +} +static gpointer setup_go_down_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_SOUTH); + return o; +} + +static gpointer setup_send_down_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = setup_follow(i, doc, node); + setup_rel(o, i, doc, node, FALSE, OB_DIRECTION_SOUTH); return o; } diff --git a/openbox/actions/directionalwindows.c b/openbox/actions/directionalwindows.c index 55c9e60..88c1dc4 100644 --- a/openbox/actions/directionalwindows.c +++ b/openbox/actions/directionalwindows.c @@ -4,6 +4,7 @@ #include "openbox/window.h" #include "openbox/focus_cycle.h" #include "openbox/openbox.h" +#include "openbox/client.h" #include "openbox/misc.h" #include "gettext.h" @@ -21,10 +22,38 @@ typedef struct { static gboolean cycling = FALSE; static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static gpointer setup_cycle_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node); -static gpointer setup_target_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node); +static gpointer setup_north_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_south_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_east_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_west_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_northwest_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_northeast_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_southwest_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_southeast_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_north_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_south_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_east_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_west_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_northwest_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_northeast_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_southwest_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_southeast_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); static gboolean i_input_func(guint initial_state, @@ -37,10 +66,38 @@ static void end_cycle(gboolean cancel, guint state, Options *o); void action_directionalwindows_startup(void) { - actions_register("DirectionalCycleWindows", setup_cycle_func, free_func, - run_func, i_input_func, i_cancel_func); - actions_register("DirectionalTargetWindow", setup_target_func, free_func, - run_func, NULL, NULL); + actions_register("DirectionalFocusNorth", setup_north_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalFocusSouth", setup_south_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalFocusWest", setup_west_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalFocusEast", setup_east_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalFocusNorthWest", setup_northwest_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalFocusNorthEast", setup_northeast_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalFocusSouthWest", setup_southwest_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalFocusSouthEast", setup_southeast_cycle_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetNorth", setup_north_target_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetSouth", setup_south_target_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetWest", setup_west_target_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetEast", setup_east_target_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetNorthWest", setup_northwest_target_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetNorthEast", setup_northeast_target_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetSouthWest", setup_southwest_target_func, + free_func, run_func, i_input_func, i_cancel_func); + actions_register("DirectionalTargetSouthEast", setup_southeast_target_func, + free_func, run_func, i_input_func, i_cancel_func); } static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) @@ -62,30 +119,6 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) o->dock_windows = parse_bool(doc, n); if ((n = parse_find_node("desktop", node))) o->desktop_windows = parse_bool(doc, n); - if ((n = parse_find_node("direction", node))) { - gchar *s = parse_string(doc, n); - if (!g_ascii_strcasecmp(s, "north") || - !g_ascii_strcasecmp(s, "up")) - o->direction = OB_DIRECTION_NORTH; - else if (!g_ascii_strcasecmp(s, "northwest")) - o->direction = OB_DIRECTION_NORTHWEST; - else if (!g_ascii_strcasecmp(s, "northeast")) - o->direction = OB_DIRECTION_NORTHEAST; - else if (!g_ascii_strcasecmp(s, "west") || - !g_ascii_strcasecmp(s, "left")) - o->direction = OB_DIRECTION_WEST; - else if (!g_ascii_strcasecmp(s, "east") || - !g_ascii_strcasecmp(s, "right")) - o->direction = OB_DIRECTION_EAST; - else if (!g_ascii_strcasecmp(s, "south") || - !g_ascii_strcasecmp(s, "down")) - o->direction = OB_DIRECTION_SOUTH; - else if (!g_ascii_strcasecmp(s, "southwest")) - o->direction = OB_DIRECTION_SOUTHWEST; - else if (!g_ascii_strcasecmp(s, "southeast")) - o->direction = OB_DIRECTION_SOUTHEAST; - g_free(s); - } if ((n = parse_find_node("finalactions", node))) { xmlNodePtr m; @@ -109,19 +142,147 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) return o; } -static gpointer setup_cycle_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node) +static gpointer setup_north_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = TRUE; + o->direction = OB_DIRECTION_NORTH; + return o; +} + +static gpointer setup_south_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = TRUE; + o->direction = OB_DIRECTION_SOUTH; + return o; +} + +static gpointer setup_east_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = TRUE; + o->direction = OB_DIRECTION_EAST; + return o; +} + +static gpointer setup_west_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = TRUE; + o->direction = OB_DIRECTION_WEST; + return o; +} + +static gpointer setup_northwest_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = TRUE; + o->direction = OB_DIRECTION_NORTHWEST; + return o; +} + +static gpointer setup_northeast_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = TRUE; + o->direction = OB_DIRECTION_EAST; + return o; +} + +static gpointer setup_southwest_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = TRUE; + o->direction = OB_DIRECTION_SOUTHWEST; + return o; +} + +static gpointer setup_southeast_cycle_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) { Options *o = setup_func(i, doc, node); o->interactive = TRUE; + o->direction = OB_DIRECTION_SOUTHEAST; + return o; +} + +static gpointer setup_north_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = FALSE; + o->direction = OB_DIRECTION_NORTH; + return o; +} + +static gpointer setup_south_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = FALSE; + o->direction = OB_DIRECTION_SOUTH; + return o; +} + +static gpointer setup_east_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = FALSE; + o->direction = OB_DIRECTION_EAST; + return o; +} + +static gpointer setup_west_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = FALSE; + o->direction = OB_DIRECTION_WEST; + return o; +} + +static gpointer setup_northwest_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = FALSE; + o->direction = OB_DIRECTION_NORTHWEST; + return o; +} + +static gpointer setup_northeast_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = FALSE; + o->direction = OB_DIRECTION_NORTHEAST; + return o; +} + +static gpointer setup_southwest_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->interactive = FALSE; + o->direction = OB_DIRECTION_SOUTHWEST; return o; } -static gpointer setup_target_func(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node) +static gpointer setup_southeast_target_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) { Options *o = setup_func(i, doc, node); o->interactive = FALSE; + o->direction = OB_DIRECTION_SOUTHEAST; return o; } diff --git a/openbox/actions/focus.c b/openbox/actions/focus.c index 0ef9d26..a157b4a 100644 --- a/openbox/actions/focus.c +++ b/openbox/actions/focus.c @@ -5,9 +5,12 @@ typedef struct { gboolean here; + gboolean activate; } Options; static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_activate_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); @@ -18,6 +21,11 @@ void action_focus_startup(void) free_func, run_func, NULL, NULL); + actions_register("Activate", + setup_activate_func, + free_func, + run_func, + NULL, NULL); } static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) @@ -32,6 +40,14 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) return o; } +static gpointer setup_activate_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = setup_func(i, doc, node); + o->activate = TRUE; + return o; +} + static void free_func(gpointer options) { Options *o = options; @@ -56,7 +72,8 @@ static gboolean run_func(ObActionsData *data, gpointer options) data->context != OB_FRAME_CONTEXT_FRAME)) { actions_client_move(data, TRUE); - client_activate(data->client, o->here, FALSE, FALSE, TRUE); + client_activate(data->client, o->here, + o->activate, o->activate, TRUE); actions_client_move(data, FALSE); } } else if (data->context == OB_FRAME_CONTEXT_DESKTOP) { diff --git a/openbox/actions/growtoedge.c b/openbox/actions/growtoedge.c index 69b8ef7..a18390d 100644 --- a/openbox/actions/growtoedge.c +++ b/openbox/actions/growtoedge.c @@ -9,52 +9,58 @@ typedef struct { ObDirection dir; } Options; -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static void free_func(gpointer options); +static gpointer setup_north_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_south_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_east_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_west_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); void action_growtoedge_startup(void) { - actions_register("GrowToEdge", - setup_func, - free_func, - run_func, + actions_register("GrowToEdgeNorth", setup_north_func, g_free, run_func, + NULL, NULL); + actions_register("GrowToEdgeSouth", setup_south_func, g_free, run_func, + NULL, NULL); + actions_register("GrowToEdgeEast", setup_east_func, g_free, run_func, + NULL, NULL); + actions_register("GrowToEdgeWest", setup_west_func, g_free, run_func, NULL, NULL); } -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +static gpointer setup_north_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) { - xmlNodePtr n; - Options *o; - - o = g_new0(Options, 1); + Options *o = g_new0(Options, 1); o->dir = OB_DIRECTION_NORTH; + return o; +} - if ((n = parse_find_node("direction", node))) { - gchar *s = parse_string(doc, n); - if (!g_ascii_strcasecmp(s, "north") || - !g_ascii_strcasecmp(s, "up")) - o->dir = OB_DIRECTION_NORTH; - else if (!g_ascii_strcasecmp(s, "south") || - !g_ascii_strcasecmp(s, "down")) - o->dir = OB_DIRECTION_SOUTH; - else if (!g_ascii_strcasecmp(s, "west") || - !g_ascii_strcasecmp(s, "left")) - o->dir = OB_DIRECTION_WEST; - else if (!g_ascii_strcasecmp(s, "east") || - !g_ascii_strcasecmp(s, "right")) - o->dir = OB_DIRECTION_EAST; - g_free(s); - } - +static gpointer setup_south_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->dir = OB_DIRECTION_SOUTH; return o; } -static void free_func(gpointer options) +static gpointer setup_east_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) { - Options *o = options; + Options *o = g_new0(Options, 1); + o->dir = OB_DIRECTION_EAST; + return o; +} - g_free(o); +static gpointer setup_west_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->dir = OB_DIRECTION_WEST; + return o; } static gboolean do_grow(ObActionsData *data, gint x, gint y, gint w, gint h) diff --git a/openbox/actions/if.c b/openbox/actions/if.c deleted file mode 100644 index 4c98966..0000000 --- a/openbox/actions/if.c +++ /dev/null @@ -1,144 +0,0 @@ -#include "openbox/actions.h" -#include "openbox/misc.h" -#include "openbox/client.h" -#include "openbox/frame.h" -#include "openbox/screen.h" -#include "openbox/focus.h" -#include - -typedef struct { - gboolean shaded_on; - gboolean shaded_off; - gboolean maxvert_on; - gboolean maxvert_off; - gboolean maxhorz_on; - gboolean maxhorz_off; - gboolean maxfull_on; - gboolean maxfull_off; - gboolean iconic_on; - gboolean iconic_off; - gboolean focused; - gboolean unfocused; - GSList *thenacts; - GSList *elseacts; -} Options; - -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) -{ - actions_register("If", - setup_func, - free_func, - run_func, - NULL, NULL); -} - -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) -{ - xmlNodePtr n; - Options *o; - - o = g_new0(Options, 1); - - if ((n = parse_find_node("shaded", node))) { - if (parse_bool(doc, n)) - o->shaded_on = TRUE; - else - o->shaded_off = TRUE; - } - if ((n = parse_find_node("maximized", node))) { - if (parse_bool(doc, n)) - o->maxfull_on = TRUE; - else - o->maxfull_off = TRUE; - } - if ((n = parse_find_node("maximizedhorizontal", node))) { - if (parse_bool(doc, n)) - o->maxhorz_on = TRUE; - else - o->maxhorz_off = TRUE; - } - if ((n = parse_find_node("maximizedvertical", node))) { - if (parse_bool(doc, n)) - o->maxvert_on = TRUE; - else - o->maxvert_off = TRUE; - } - if ((n = parse_find_node("iconified", node))) { - if (parse_bool(doc, n)) - o->iconic_on = TRUE; - else - o->iconic_off = TRUE; - } - if ((n = parse_find_node("focused", node))) { - if (parse_bool(doc, n)) - o->focused = TRUE; - else - o->unfocused = TRUE; - } - - if ((n = parse_find_node("then", node))) { - xmlNodePtr m; - - m = parse_find_node("action", n->xmlChildrenNode); - while (m) { - ObActionsAct *action = actions_parse(i, doc, m); - if (action) o->thenacts = g_slist_append(o->thenacts, action); - m = parse_find_node("action", m->next); - } - } - if ((n = parse_find_node("else", node))) { - xmlNodePtr m; - - m = parse_find_node("action", n->xmlChildrenNode); - while (m) { - ObActionsAct *action = actions_parse(i, doc, m); - if (action) o->elseacts = g_slist_append(o->elseacts, action); - m = parse_find_node("action", m->next); - } - } - - return o; -} - -static void free_func(gpointer options) -{ - Options *o = options; - - g_free(o); -} - -/* Always return FALSE because its not interactive */ -static gboolean run_func(ObActionsData *data, gpointer options) -{ - Options *o = options; - GSList *acts; - ObClient *c = data->client; - - if ((!o->shaded_on || (c && c->shaded)) && - (!o->shaded_off || (c && !c->shaded)) && - (!o->iconic_on || (c && c->iconic)) && - (!o->iconic_off || (c && !c->iconic)) && - (!o->maxhorz_on || (c && c->max_horz)) && - (!o->maxhorz_off || (c && !c->max_horz)) && - (!o->maxvert_on || (c && c->max_vert)) && - (!o->maxvert_off || (c && !c->max_vert)) && - (!o->maxfull_on || (c && c->max_vert && c->max_horz)) && - (!o->maxfull_off || (c && !(c->max_vert && c->max_horz))) && - (!o->focused || (c && (c == focus_client))) && - (!o->unfocused || (c && !(c == focus_client)))) - { - acts = o->thenacts; - } - else - acts = o->elseacts; - - actions_run_acts(acts, data->uact, data->state, - data->x, data->y, data->button, - data->context, data->client); - - return FALSE; -} diff --git a/openbox/actions/layer.c b/openbox/actions/layer.c index 92fa480..6a8e698 100644 --- a/openbox/actions/layer.c +++ b/openbox/actions/layer.c @@ -9,8 +9,12 @@ typedef struct { static gpointer setup_func_top(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static gpointer setup_func_bottom(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static gpointer setup_func_send(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node); +static gpointer setup_sendtop_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_sendbottom_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_sendnormal_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); void action_layer_startup(void) @@ -19,7 +23,11 @@ void action_layer_startup(void) run_func, NULL, NULL); actions_register("ToggleAlwaysOnBottom", setup_func_bottom, g_free, run_func, NULL, NULL); - actions_register("SendToLayer", setup_func_send, g_free, + actions_register("SendToTopLayer", setup_sendtop_func, g_free, + run_func, NULL, NULL); + actions_register("SendToBottomLayer", setup_sendbottom_func, g_free, + run_func, NULL, NULL); + actions_register("SendToNormalLayer", setup_sendnormal_func, g_free, run_func, NULL, NULL); } @@ -40,28 +48,30 @@ static gpointer setup_func_bottom(ObParseInst *i, xmlDocPtr doc, return o; } -static gpointer setup_func_send(ObParseInst *i, xmlDocPtr doc, - xmlNodePtr node) +static gpointer setup_sendtop_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) { - xmlNodePtr n; - Options *o; - - o = g_new0(Options, 1); + Options *o = g_new0(Options, 1); + o->layer = 1; + o->toggle = FALSE; + return o; +} - if ((n = parse_find_node("layer", node))) { - gchar *s = parse_string(doc, n); - if (!g_ascii_strcasecmp(s, "above") || - !g_ascii_strcasecmp(s, "top")) - o->layer = 1; - else if (!g_ascii_strcasecmp(s, "below") || - !g_ascii_strcasecmp(s, "bottom")) - o->layer = -1; - else if (!g_ascii_strcasecmp(s, "normal") || - !g_ascii_strcasecmp(s, "middle")) - o->layer = 0; - g_free(s); - } +static gpointer setup_sendbottom_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->layer = -1; + o->toggle = FALSE; + return o; +} +static gpointer setup_sendnormal_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->layer = 0; + o->toggle = FALSE; return o; } diff --git a/openbox/actions/maximize.c b/openbox/actions/maximize.c index bb6f470..fa896ed 100644 --- a/openbox/actions/maximize.c +++ b/openbox/actions/maximize.c @@ -12,40 +12,56 @@ typedef struct { MaxDirection dir; } Options; -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_both_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_horz_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_vert_func(ObParseInst *i, + xmlDocPtr doc, xmlNodePtr node); 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) { - actions_register("Maximize", setup_func, g_free, run_func_on, - NULL, NULL); - actions_register("Unmaximize", setup_func, g_free, run_func_off, - NULL, NULL); - actions_register("ToggleMaximize", setup_func, g_free, run_func_toggle, - NULL, NULL); + actions_register("MaximizeFull", setup_both_func, g_free, + run_func_on, NULL, NULL); + actions_register("UnmaximizeFull", setup_both_func, g_free, + run_func_off, NULL, NULL); + actions_register("ToggleMaximizeFull", setup_both_func, g_free, + run_func_toggle, NULL, NULL); + actions_register("MaximizeHorz", setup_horz_func, g_free, + run_func_on, NULL, NULL); + actions_register("UnmaximizeHorz", setup_horz_func, g_free, + run_func_off, NULL, NULL); + actions_register("ToggleMaximizeHorz", setup_horz_func, g_free, + run_func_toggle, NULL, NULL); + actions_register("MaximizeVert", setup_vert_func, g_free, + run_func_on, NULL, NULL); + actions_register("UnmaximizeVert", setup_vert_func, g_free, + run_func_off, NULL, NULL); + actions_register("ToggleMaximizeVert", setup_vert_func, g_free, + run_func_toggle, NULL, NULL); } -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +static gpointer setup_both_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) { - xmlNodePtr n; - Options *o; - - o = g_new0(Options, 1); + Options *o = g_new0(Options, 1); o->dir = BOTH; + return o; +} - if ((n = parse_find_node("direction", node))) { - gchar *s = parse_string(doc, n); - if (!g_ascii_strcasecmp(s, "vertical") || - !g_ascii_strcasecmp(s, "vert")) - o->dir = VERT; - else if (!g_ascii_strcasecmp(s, "horizontal") || - !g_ascii_strcasecmp(s, "horz")) - o->dir = HORZ; - g_free(s); - } +static gpointer setup_horz_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->dir = HORZ; + return o; +} +static gpointer setup_vert_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->dir = VERT; return o; } diff --git a/openbox/actions/moveresizeto.c b/openbox/actions/moveresizeto.c index cdd772a..b5a8de9 100644 --- a/openbox/actions/moveresizeto.c +++ b/openbox/actions/moveresizeto.c @@ -22,6 +22,8 @@ typedef struct { } Options; static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_center_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); @@ -32,6 +34,11 @@ void action_moveresizeto_startup(void) free_func, run_func, NULL, NULL); + actions_register("MoveToCenter", + setup_center_func, + free_func, + run_func, + NULL, NULL); } static void parse_coord(xmlDocPtr doc, xmlNodePtr n, gint *pos, @@ -98,6 +105,22 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) return o; } +static gpointer setup_center_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o; + + o = g_new0(Options, 1); + o->x = G_MININT; + o->y = G_MININT; + o->w = G_MININT; + o->h = G_MININT; + o->monitor = -1; + o->xcenter = TRUE; + o->ycenter = TRUE; + return o; +} + static void free_func(gpointer options) { Options *o = options; diff --git a/openbox/actions/movetoedge.c b/openbox/actions/movetoedge.c index 5941bde..91c95ad 100644 --- a/openbox/actions/movetoedge.c +++ b/openbox/actions/movetoedge.c @@ -9,52 +9,58 @@ typedef struct { ObDirection dir; } Options; -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static void free_func(gpointer options); +static gpointer setup_north_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_south_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_east_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); +static gpointer setup_west_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); void action_movetoedge_startup(void) { - actions_register("MoveToEdge", - setup_func, - free_func, - run_func, + actions_register("MoveToEdgeNorth", setup_north_func, g_free, run_func, + NULL, NULL); + actions_register("MoveToEdgeSouth", setup_south_func, g_free, run_func, + NULL, NULL); + actions_register("MoveToEdgeEast", setup_east_func, g_free, run_func, + NULL, NULL); + actions_register("MoveToEdgeWest", setup_west_func, g_free, run_func, NULL, NULL); } -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +static gpointer setup_north_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) { - xmlNodePtr n; - Options *o; - - o = g_new0(Options, 1); + Options *o = g_new0(Options, 1); o->dir = OB_DIRECTION_NORTH; + return o; +} - if ((n = parse_find_node("direction", node))) { - gchar *s = parse_string(doc, n); - if (!g_ascii_strcasecmp(s, "north") || - !g_ascii_strcasecmp(s, "up")) - o->dir = OB_DIRECTION_NORTH; - else if (!g_ascii_strcasecmp(s, "south") || - !g_ascii_strcasecmp(s, "down")) - o->dir = OB_DIRECTION_SOUTH; - else if (!g_ascii_strcasecmp(s, "west") || - !g_ascii_strcasecmp(s, "left")) - o->dir = OB_DIRECTION_WEST; - else if (!g_ascii_strcasecmp(s, "east") || - !g_ascii_strcasecmp(s, "right")) - o->dir = OB_DIRECTION_EAST; - g_free(s); - } - +static gpointer setup_south_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->dir = OB_DIRECTION_SOUTH; return o; } -static void free_func(gpointer options) +static gpointer setup_east_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) { - Options *o = options; + Options *o = g_new0(Options, 1); + o->dir = OB_DIRECTION_EAST; + return o; +} - g_free(o); +static gpointer setup_west_func(ObParseInst *i, xmlDocPtr doc, + xmlNodePtr node) +{ + Options *o = g_new0(Options, 1); + o->dir = OB_DIRECTION_WEST; + return o; } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/shadelowerraise.c b/openbox/actions/shadelowerraise.c new file mode 100644 index 0000000..e9ba12d --- /dev/null +++ b/openbox/actions/shadelowerraise.c @@ -0,0 +1,39 @@ +#include "openbox/actions.h" +#include "openbox/client.h" + +static gboolean run_func_sl(ObActionsData *data, gpointer options); +static gboolean run_func_ur(ObActionsData *data, gpointer options); + +void action_shadelowerraise_startup() +{ + actions_register("ShadeLower", NULL, NULL, run_func_sl, NULL, NULL); + actions_register("UnshadeRaise", NULL, NULL, run_func_ur, NULL, NULL); +} + +/* Always return FALSE because its not interactive */ +static gboolean run_func_sl(ObActionsData *data, gpointer options) +{ + if (data->client) { + actions_client_move(data, TRUE); + if (data->client->shaded) + stacking_lower(CLIENT_AS_WINDOW(data->client)); + else + client_shade(data->client, TRUE); + actions_client_move(data, FALSE); + } + return FALSE; +} + +/* Always return FALSE because its not interactive */ +static gboolean run_func_ur(ObActionsData *data, gpointer options) +{ + if (data->client) { + actions_client_move(data, TRUE); + if (data->client->shaded) + client_shade(data->client, FALSE); + else + stacking_raise(CLIENT_AS_WINDOW(data->client)); + actions_client_move(data, FALSE); + } + return FALSE; +} diff --git a/openbox/client.h b/openbox/client.h index c2461cb..b4110f3 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -322,14 +322,14 @@ void client_add_destroy_notify(ObClientCallback func, gpointer data); void client_remove_destroy_notify(ObClientCallback func); /*! Manages all existing windows */ -void client_manage_all(); +void client_manage_all(void); /*! Manages a given window @param prompt This specifies an ObPrompt which is being managed. It is possible to manage Openbox-owned windows through this. */ void client_manage(Window win, struct _ObPrompt *prompt); /*! Unmanages all managed windows */ -void client_unmanage_all(); +void client_unmanage_all(void); /*! Unmanages a given client */ void client_unmanage(ObClient *client); @@ -342,7 +342,7 @@ ObClient *client_fake_manage(Window win); void client_fake_unmanage(ObClient *self); /*! Sets the client list on the root window from the client_list */ -void client_set_list(); +void client_set_list(void); /*! Determines if the client should be shown or hidden currently. @return TRUE if it should be visible; otherwise, FALSE. @@ -717,7 +717,7 @@ void client_set_layer(ObClient *self, gint layer); guint client_monitor(ObClient *self); -ObClient* client_under_pointer(); +ObClient* client_under_pointer(void); gboolean client_has_group_siblings(ObClient *self); diff --git a/openbox/client_menu.h b/openbox/client_menu.h index fe14502..5c55516 100644 --- a/openbox/client_menu.h +++ b/openbox/client_menu.h @@ -19,6 +19,6 @@ #ifndef ob__client_menu_h #define ob__client_menu_h -void client_menu_startup(); +void client_menu_startup(void); #endif diff --git a/openbox/config.c b/openbox/config.c index 00efd5e..329c6ed 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -887,7 +887,7 @@ static void bind_default_mouse(void) { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "Raise" }, { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "Raise" }, { "Left", "Close", OB_MOUSE_ACTION_CLICK, "Close" }, - { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "ToggleMaximize" }, + { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "ToggleMaximizeFull" }, { "Left", "Iconify", OB_MOUSE_ACTION_CLICK, "Iconify" }, { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "ToggleOmnipresent" }, { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "ToggleShade" }, diff --git a/openbox/config.h b/openbox/config.h index 62b9247..b504b55 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -189,10 +189,10 @@ extern GSList *config_menu_files; extern GSList *config_per_app_settings; void config_startup(struct _ObParseInst *i); -void config_shutdown(); +void config_shutdown(void); /*! Create an ObAppSettings structure with the default values */ -ObAppSettings* config_create_app_settings(); +ObAppSettings* config_create_app_settings(void); /*! Copies any settings in src to dest, if they are their default value in src. */ void config_app_settings_copy_non_defaults(const ObAppSettings *src, diff --git a/openbox/dock.h b/openbox/dock.h index 57c1f39..dab71f5 100644 --- a/openbox/dock.h +++ b/openbox/dock.h @@ -68,12 +68,12 @@ extern StrutPartial dock_strut; void dock_startup(gboolean reconfig); void dock_shutdown(gboolean reconfig); -void dock_configure(); +void dock_configure(void); void dock_hide(gboolean hide); void dock_add(Window win, XWMHints *wmhints); -void dock_remove_all(); +void dock_remove_all(void); void dock_remove(ObDockApp *app, gboolean reparent); void dock_app_drag(ObDockApp *app, XMotionEvent *e); diff --git a/openbox/event.h b/openbox/event.h index 93af6b4..1dec416 100644 --- a/openbox/event.h +++ b/openbox/event.h @@ -47,7 +47,7 @@ void event_enter_client(struct _ObClient *client); /*! Make mouse focus not move at all from the stuff that happens between these two function calls. */ -gulong event_start_ignore_all_enters(); +gulong event_start_ignore_all_enters(void); void event_end_ignore_all_enters(gulong start); /*! End *all* active and passive grabs on the keyboard @@ -57,16 +57,16 @@ void event_end_ignore_all_enters(gulong start); Actions should not rely on being able to move focus during an interactive grab. */ -void event_cancel_all_key_grabs(); +void event_cancel_all_key_grabs(void); /* Halts any focus delay in progress, use this when the user is selecting a window for focus */ -void event_halt_focus_delay(); +void event_halt_focus_delay(void); /*! Compare t1 and t2, taking into account wraparound. True if t1 comes at the same time or later than t2. */ gboolean event_time_after(Time t1, Time t2); -Time event_get_server_time(); +Time event_get_server_time(void); #endif diff --git a/openbox/extensions.h b/openbox/extensions.h index 3155874..9f74b10 100644 --- a/openbox/extensions.h +++ b/openbox/extensions.h @@ -67,7 +67,7 @@ extern gboolean extensions_sync; /*! Base for events for the Sync extension */ extern gint extensions_sync_event_basep; -void extensions_query_all(); +void extensions_query_all(void); void extensions_xinerama_screens(Rect **areas, guint *nxin); diff --git a/openbox/focus.h b/openbox/focus.h index b8f8999..4f37b72 100644 --- a/openbox/focus.h +++ b/openbox/focus.h @@ -41,7 +41,7 @@ void focus_shutdown(gboolean reconfig); void focus_set_client(struct _ObClient *client); /*! Focus nothing, but let keyboard events be caught. */ -void focus_nothing(); +void focus_nothing(void); /*! Call this when you need to focus something! */ struct _ObClient* focus_fallback(gboolean allow_refocus, diff --git a/openbox/focus_cycle_popup.h b/openbox/focus_cycle_popup.h index ded39e2..4e8c775 100644 --- a/openbox/focus_cycle_popup.h +++ b/openbox/focus_cycle_popup.h @@ -30,13 +30,13 @@ void focus_cycle_popup_shutdown(gboolean reconfig); void focus_cycle_popup_show(struct _ObClient *c, gboolean iconic_windows, gboolean all_desktops, gboolean dock_windows, gboolean desktop_windows); -void focus_cycle_popup_hide(); +void focus_cycle_popup_hide(void); void focus_cycle_popup_single_show(struct _ObClient *c, gboolean iconic_windows, gboolean all_desktops, gboolean dock_windows, gboolean desktop_windows); -void focus_cycle_popup_single_hide(); +void focus_cycle_popup_single_hide(void); #endif diff --git a/openbox/frame.c b/openbox/frame.c index 0b764a4..d4372cd 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -1313,6 +1313,8 @@ ObFrameContext frame_context_from_string(const gchar *name) return OB_FRAME_CONTEXT_TOP; else if (!g_ascii_strcasecmp("Bottom", name)) return OB_FRAME_CONTEXT_BOTTOM; + else if (!g_ascii_strcasecmp("Handle", name)) + return OB_FRAME_CONTEXT_BOTTOM; else if (!g_ascii_strcasecmp("Left", name)) return OB_FRAME_CONTEXT_LEFT; else if (!g_ascii_strcasecmp("Right", name)) diff --git a/openbox/grab.h b/openbox/grab.h index 30c4b70..8253637 100644 --- a/openbox/grab.h +++ b/openbox/grab.h @@ -38,8 +38,8 @@ gint grab_server(gboolean grab); #define grab_pointer(o,c,u) grab_pointer_full(TRUE, (o), (c), (u)) #define ungrab_pointer() grab_pointer_full(FALSE, FALSE, FALSE, OB_CURSOR_NONE) -gboolean grab_on_keyboard(); -gboolean grab_on_pointer(); +gboolean grab_on_keyboard(void); +gboolean grab_on_pointer(void); void grab_button_full(guint button, guint state, Window win, guint mask, gint pointer_mode, ObCursor cursor); @@ -50,6 +50,6 @@ void grab_key(guint keycode, guint state, Window win, gint keyboard_mode); void ungrab_all_keys(Window win); void grab_key_passive_count(int change); -void ungrab_passive_key(); +void ungrab_passive_key(void); #endif diff --git a/openbox/keyboard.h b/openbox/keyboard.h index 995cdbc..1674cf9 100644 --- a/openbox/keyboard.h +++ b/openbox/keyboard.h @@ -34,11 +34,11 @@ extern KeyBindingTree *keyboard_firstnode; void keyboard_startup(gboolean reconfig); void keyboard_shutdown(gboolean reconfig); -void keyboard_rebind(); +void keyboard_rebind(void); void keyboard_chroot(GList *keylist); gboolean keyboard_bind(GList *keylist, struct _ObActionsAct *action); -void keyboard_unbind_all(); +void keyboard_unbind_all(void); void keyboard_event(struct _ObClient *client, const XEvent *e); /*! @param break_chroots how many chroots to break. -1 means to break them ALL! diff --git a/openbox/menu.h b/openbox/menu.h index 7e11545..a472226 100644 --- a/openbox/menu.h +++ b/openbox/menu.h @@ -169,13 +169,13 @@ void menu_free(ObMenu *menu); /*! Repopulate a pipe-menu by running its command */ void menu_pipe_execute(ObMenu *self); /*! Clear a pipe-menu's entries */ -void menu_clear_pipe_caches(); +void menu_clear_pipe_caches(void); void menu_show_all_shortcuts(ObMenu *self, gboolean show); void menu_show(gchar *name, gint x, gint y, gboolean mouse, struct _ObClient *client); -gboolean menu_hide_delay_reached(); +gboolean menu_hide_delay_reached(void); void menu_set_show_func(ObMenu *menu, ObMenuShowFunc func); void menu_set_hide_func(ObMenu *menu, ObMenuHideFunc func); diff --git a/openbox/menuframe.h b/openbox/menuframe.h index 1b1dcc7..274cc0c 100644 --- a/openbox/menuframe.h +++ b/openbox/menuframe.h @@ -117,7 +117,7 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y, gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent, ObMenuEntryFrame *parent_entry); -void menu_frame_hide_all(); +void menu_frame_hide_all(void); void menu_frame_hide_all_client(struct _ObClient *client); void menu_frame_render(ObMenuFrame *self); diff --git a/openbox/mouse.c b/openbox/mouse.c index f63d266..9ce84e2 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -197,7 +197,7 @@ static gboolean fire_binding(ObMouseAction a, ObFrameContext context, return TRUE; } -void mouse_replay_pointer() +void mouse_replay_pointer(void) { if (replay_pointer_needed) { /* replay the pointer event before any windows move */ diff --git a/openbox/mouse.h b/openbox/mouse.h index a862fe5..2bd5d57 100644 --- a/openbox/mouse.h +++ b/openbox/mouse.h @@ -31,7 +31,7 @@ void mouse_shutdown(gboolean reconfig); gboolean mouse_bind(const gchar *buttonstr, const gchar *contextstr, ObMouseAction mact, struct _ObActionsAct *action); -void mouse_unbind_all(); +void mouse_unbind_all(void); void mouse_event(struct _ObClient *client, XEvent *e); @@ -43,6 +43,6 @@ ObFrameContext mouse_button_frame_context(ObFrameContext context, /*! If a replay pointer is needed, then do it. Call this when windows are going to be moving/appearing/disappearing, so that you know the mouse click will go to the right window */ -void mouse_replay_pointer(); +void mouse_replay_pointer(void); #endif diff --git a/openbox/openbox.c b/openbox/openbox.c index 7221556..6cd9ba9 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -515,7 +515,7 @@ static void signal_handler(gint signal, gpointer data) } } -static void print_version() +static void print_version(void) { g_print("Openbox %s\n", PACKAGE_VERSION); g_print(_("Copyright (c)")); @@ -527,7 +527,7 @@ static void print_version() g_print("under certain conditions. See the file COPYING for details.\n\n"); } -static void print_help() +static void print_help(void) { g_print(_("Syntax: openbox [options]\n")); g_print(_("\nOptions:\n")); @@ -562,7 +562,7 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num) *argc -= num; } -static void parse_env() +static void parse_env(void) { /* unset this so we don't pass it on unknowingly */ unsetenv("DESKTOP_STARTUP_ID"); @@ -691,13 +691,13 @@ void ob_restart_other(const gchar *path) ob_restart(); } -void ob_restart() +void ob_restart(void) { restart = TRUE; ob_exit(0); } -void ob_reconfigure() +void ob_reconfigure(void) { reconfigure = TRUE; ob_exit(0); @@ -709,7 +709,7 @@ void ob_exit(gint code) ob_main_loop_exit(ob_main_loop); } -void ob_exit_replace() +void ob_exit_replace(void) { exitcode = 0; being_replaced = TRUE; @@ -728,7 +728,7 @@ KeyCode ob_keycode(ObKey key) return keys[key]; } -ObState ob_state() +ObState ob_state(void) { return state; } diff --git a/openbox/openbox.h b/openbox/openbox.h index 06d3829..2c0f38c 100644 --- a/openbox/openbox.h +++ b/openbox/openbox.h @@ -51,15 +51,15 @@ extern gboolean ob_replace_wm; extern gboolean ob_debug_xinerama; /* The state of execution of the window manager */ -ObState ob_state(); +ObState ob_state(void); void ob_set_state(ObState state); void ob_restart_other(const gchar *path); -void ob_restart(); +void ob_restart(void); void ob_exit(gint code); -void ob_exit_replace(); +void ob_exit_replace(void); -void ob_reconfigure(); +void ob_reconfigure(void); void ob_exit_with_error(const gchar *msg); diff --git a/openbox/popup.h b/openbox/popup.h index 2b01ce2..503e277 100644 --- a/openbox/popup.h +++ b/openbox/popup.h @@ -77,7 +77,7 @@ struct _ObPagerPopup RrAppearance *unhilight; }; -ObPopup *popup_new(); +ObPopup *popup_new(void); void popup_free(ObPopup *self); /*! Position the popup. The gravity rules are not the same X uses for windows, @@ -105,7 +105,7 @@ void popup_hide(ObPopup *self); RrAppearance *popup_icon_appearance(ObPopup *self); -ObIconPopup *icon_popup_new(); +ObIconPopup *icon_popup_new(void); void icon_popup_free(ObIconPopup *self); #define icon_popup_show(s, t, i) icon_popup_delay_show((s),0,(t),(i)) @@ -124,7 +124,7 @@ void icon_popup_delay_show(ObIconPopup *self, gulong usec, #define icon_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j)) void icon_popup_icon_size_multiplier(ObIconPopup *self, guint wm, guint hm); -ObPagerPopup *pager_popup_new(); +ObPagerPopup *pager_popup_new(void); void pager_popup_free(ObPagerPopup *self); #define pager_popup_show(s, t, d) pager_popup_delay_show((s),0,(t),(d)) diff --git a/openbox/prop.h b/openbox/prop.h index 46c9301..fd5d6c1 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -204,7 +204,7 @@ typedef struct Atoms { } Atoms; extern Atoms prop_atoms; -void prop_startup(); +void prop_startup(void); gboolean prop_get32(Window win, Atom prop, Atom type, guint32 *ret); gboolean prop_get_array32(Window win, Atom prop, Atom type, guint32 **ret, diff --git a/openbox/screen.h b/openbox/screen.h index 39871e3..11915f1 100644 --- a/openbox/screen.h +++ b/openbox/screen.h @@ -53,7 +53,7 @@ extern ObDesktopLayout screen_desktop_layout; extern gchar **screen_desktop_names; /*! Take over the screen, set the basic hints on it claming it as ours */ -gboolean screen_annex(); +gboolean screen_annex(void); /*! Once the screen is ours, set up its initial state */ void screen_startup(gboolean reconfig); @@ -61,7 +61,7 @@ void screen_startup(gboolean reconfig); void screen_shutdown(gboolean reconfig); /*! Figure out the new size of the screen and adjust stuff for it */ -void screen_resize(); +void screen_resize(void); /*! Change the number of available desktops */ void screen_set_num_desktops(guint num); @@ -78,7 +78,7 @@ 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(); +void screen_hide_desktop_popup(void); /*! Shows and focuses the desktop and hides all the client windows, or returns to the normal state, showing client windows. @@ -89,22 +89,22 @@ void screen_hide_desktop_popup(); void screen_show_desktop(gboolean show, struct _ObClient *show_only); /*! Updates the desktop layout from the root property if available */ -void screen_update_layout(); +void screen_update_layout(void); /*! Get desktop names from the root window property */ -void screen_update_desktop_names(); +void screen_update_desktop_names(void); /*! Installs or uninstalls a colormap for a client. If client is NULL, then it handles the root colormap. */ void screen_install_colormap(struct _ObClient *client, gboolean install); -void screen_update_areas(); +void screen_update_areas(void); -Rect *screen_physical_area_all_monitors(); +Rect *screen_physical_area_all_monitors(void); Rect *screen_physical_area_monitor(guint head); -Rect *screen_physical_area_active(); +Rect *screen_physical_area_active(void); /* doesn't include struts which the search area is already outside of when 'search' is not NULL */ @@ -127,7 +127,7 @@ guint screen_find_monitor(Rect *search); /*! Sets the root cursor. This function decides which cursor to use, but you gotta call it to let it know it should change. */ -void screen_set_root_cursor(); +void screen_set_root_cursor(void); /*! Gives back the pointer's position in x and y. Returns TRUE if the pointer is on this screen and FALSE if it is on another screen. */ diff --git a/openbox/session.c b/openbox/session.c index 4483c05..59faa30 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -156,7 +156,7 @@ void session_shutdown(gboolean permanent) } /*! Connect to the session manager and set up our callback functions */ -static gboolean session_connect() +static gboolean session_connect(void) { SmcCallbacks cb; gchar *oldid; @@ -190,7 +190,7 @@ static gboolean session_connect() return sm_conn != NULL; } -static void session_setup_program() +static void session_setup_program(void) { SmPropValue vals = { .value = sm_argv[0], @@ -209,7 +209,7 @@ static void session_setup_program() g_free(prop.type); } -static void session_setup_user() +static void session_setup_user(void) { char *user = g_strdup(g_get_user_name()); @@ -252,7 +252,7 @@ static void session_setup_restart_style(gboolean restart) g_free(prop.type); } -static void session_setup_pid() +static void session_setup_pid(void) { gchar *pid = g_strdup_printf("%ld", (glong) getpid()); @@ -275,7 +275,7 @@ static void session_setup_pid() } /*! This is a gnome-session-manager extension */ -static void session_setup_priority() +static void session_setup_priority(void) { gchar priority = 20; /* 20 is a lower prioity to run before other apps */ @@ -296,7 +296,7 @@ static void session_setup_priority() g_free(prop.type); } -static void session_setup_clone_command() +static void session_setup_clone_command(void) { gint i; @@ -322,7 +322,7 @@ static void session_setup_clone_command() g_free(vals); } -static void session_setup_restart_command() +static void session_setup_restart_command(void) { gint i; @@ -364,7 +364,7 @@ static void session_setup_restart_command() g_free(vals); } -static ObSMSaveData *sm_save_get_data() +static ObSMSaveData *sm_save_get_data(void) { ObSMSaveData *savedata = g_new0(ObSMSaveData, 1); /* save the active desktop and client. diff --git a/openbox/stacking.h b/openbox/stacking.h index e226f36..773f658 100644 --- a/openbox/stacking.h +++ b/openbox/stacking.h @@ -43,7 +43,7 @@ extern GList *stacking_list; /*! Sets the window stacking list on the root window from the stacking_list */ -void stacking_set_list(); +void stacking_set_list(void); void stacking_add(struct _ObWindow *win); void stacking_add_nonintrusive(struct _ObWindow *win); @@ -56,7 +56,7 @@ void stacking_raise(struct _ObWindow *window); void stacking_temp_raise(struct _ObWindow *window); /*! Restores any temporarily raised windows to their correct place */ -void stacking_restore(); +void stacking_restore(void); /*! Lowers a window below all others in its stacking layer */ void stacking_lower(struct _ObWindow *window); diff --git a/openbox/startupnotify.h b/openbox/startupnotify.h index 758beee..d524bca 100644 --- a/openbox/startupnotify.h +++ b/openbox/startupnotify.h @@ -25,7 +25,7 @@ void sn_startup(gboolean reconfig); void sn_shutdown(gboolean reconfig); -gboolean sn_app_starting(); +gboolean sn_app_starting(void); /*! Notify that an app has started @param wmclass the WM_CLASS[1] hint @@ -45,6 +45,6 @@ void sn_setup_spawn_environment(const gchar *program, const gchar *name, /* Tell startup notification we're not actually running the program we told it we were */ -void sn_spawn_cancel(); +void sn_spawn_cancel(void); #endif diff --git a/parser/parse.h b/parser/parse.h index 28af64b..ccd4e45 100644 --- a/parser/parse.h +++ b/parser/parse.h @@ -31,7 +31,7 @@ typedef struct _ObParseInst ObParseInst; typedef void (*ParseCallback)(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, gpointer data); -ObParseInst* parse_startup(); +ObParseInst* parse_startup(void); void parse_shutdown(ObParseInst *inst); /*! Loads Openbox's rc, from the normal paths @@ -77,13 +77,13 @@ gboolean parse_attr_bool(const gchar *name, xmlNodePtr node, gboolean *value); /* paths */ -void parse_paths_startup(); -void parse_paths_shutdown(); +void parse_paths_startup(void); +void parse_paths_shutdown(void); -const gchar* parse_xdg_config_home_path(); -const gchar* parse_xdg_data_home_path(); -GSList* parse_xdg_config_dir_paths(); -GSList* parse_xdg_data_dir_paths(); +const gchar* parse_xdg_config_home_path(void); +const gchar* parse_xdg_data_home_path(void); +GSList* parse_xdg_config_dir_paths(void); +GSList* parse_xdg_data_dir_paths(void); /*! Expands the ~ character to the home directory throughout the given string */ diff --git a/po/en@boldquot.po b/po/en@boldquot.po index 676483b..62ed6bf 100644 --- a/po/en@boldquot.po +++ b/po/en@boldquot.po @@ -30,7 +30,7 @@ # msgid "" msgstr "" -"Project-Id-Version: openbox 3.999.0\n" +"Project-Id-Version: openbox 3.4.7-pre1\n" "Report-Msgid-Bugs-To: http://bugzilla.icculus.org\n" "POT-Creation-Date: 2008-03-02 17:58-0500\n" "PO-Revision-Date: 2008-03-02 17:58-0500\n" diff --git a/po/en@quot.po b/po/en@quot.po index 021ba66..a98bdb2 100644 --- a/po/en@quot.po +++ b/po/en@quot.po @@ -27,7 +27,7 @@ # msgid "" msgstr "" -"Project-Id-Version: openbox 3.999.0\n" +"Project-Id-Version: openbox 3.4.7-pre1\n" "Report-Msgid-Bugs-To: http://bugzilla.icculus.org\n" "POT-Creation-Date: 2008-03-02 17:58-0500\n" "PO-Revision-Date: 2008-03-02 17:58-0500\n"