bin_PROGRAMS = \
openbox/openbox \
tools/gdm-control/gdm-control \
- tools/gnome-panel-control/gnome-panel-control
+ tools/gnome-panel-control/gnome-panel-control \
+ tools/obprop/obprop
dist_secretbin_SCRIPTS = \
tools/xdg-autostart/xdg-autostart
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/lower.c \
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 \
tools_gnome_panel_control_gnome_panel_control_SOURCES = \
tools/gnome-panel-control/gnome-panel-control.c
+ ## obprop ##
+
+ tools_obprop_obprop_CPPFLAGS = \
+ $(GLIB_CFLAGS) \
+ $(X_CFLAGS)
+ tools_obprop_obprop_LDADD = \
+ $(GLIB_LIBS) \
+ $(X_LIBS)
+ tools_obprop_obprop_SOURCES = \
+ tools/obprop/obprop.c
+
## gdm-control ##
tools_gdm_control_gdm_control_CPPFLAGS = \
data/xsession/openbox-kde-session \
data/xsession/openbox.desktop \
data/xsession/openbox-gnome.desktop \
- data/xsession/openbox-kde.desktop
+ data/xsession/openbox-kde.desktop \
+ data/autostart.sh
#doc:
# $(MAKE) -$(MAKEFLAGS) -C doc/doxygen doc
<!-- Keybindings for desktop switching -->
<keybind key="C-A-Left">
- <action name="GoToDesktop"><to>left</to><wrap>no</wrap></action>
+ <action name="DesktopLeft"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="C-A-Right">
- <action name="GoToDesktop"><to>right</to><wrap>no</wrap></action>
+ <action name="DesktopRight"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="C-A-Up">
- <action name="GoToDesktop"><to>up</to><wrap>no</wrap></action>
+ <action name="DesktopUp"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="C-A-Down">
- <action name="GoToDesktop"><to>down</to><wrap>no</wrap></action>
+ <action name="DesktopDown"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Left">
- <action name="SendToDesktop"><to>left</to><wrap>no</wrap></action>
+ <action name="SendToDesktopLeft"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Right">
- <action name="SendToDesktop"><to>right</to><wrap>no</wrap></action>
+ <action name="SendToDesktopRight"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Up">
- <action name="SendToDesktop"><to>up</to><wrap>no</wrap></action>
+ <action name="SendToDesktopUp"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Down">
- <action name="SendToDesktop"><to>down</to><wrap>no</wrap></action>
+ <action name="SendToDesktopDown"><dialog>no</dialog><wrap>no</wrap></action>
</keybind>
<keybind key="W-F1">
- <action name="GoToDesktop"><to>1</to></action>
+ <action name="Desktop"><desktop>1</desktop></action>
</keybind>
<keybind key="W-F2">
- <action name="GoToDesktop"><to>2</to></action>
+ <action name="Desktop"><desktop>2</desktop></action>
</keybind>
<keybind key="W-F3">
- <action name="GoToDesktop"><to>3</to></action>
+ <action name="Desktop"><desktop>3</desktop></action>
</keybind>
<keybind key="W-F4">
- <action name="GoToDesktop"><to>4</to></action>
+ <action name="Desktop"><desktop>4</desktop></action>
</keybind>
<keybind key="W-d">
<action name="ToggleShowDesktop"/>
<!-- Keybindings for window switching -->
<keybind key="A-Tab">
- <action name="NextWindow">
- <finalactions>
- <action name="Focus"/>
- <action name="Raise"/>
- <action name="Unshade"/>
- </finalactions>
- </action>
+ <action name="NextWindow"/>
</keybind>
<keybind key="A-S-Tab">
- <action name="PreviousWindow">
- <finalactions>
- <action name="Focus"/>
- <action name="Raise"/>
- <action name="Unshade"/>
- </finalactions>
- </action>
+ <action name="PreviousWindow"/>
</keybind>
<keybind key="C-A-Tab">
<action name="NextWindow">
<panels>yes</panels><desktop>yes</desktop>
- <finalactions>
- <action name="Focus"/>
- <action name="Raise"/>
- <action name="Unshade"/>
- </finalactions>
</action>
</keybind>
</mousebind>
<mousebind button="A-Up" action="Click">
- <action name="GoToDesktop"><to>previous</to></action>
+ <action name="DesktopPrevious"/>
</mousebind>
<mousebind button="A-Down" action="Click">
- <action name="GoToDesktop"><to>next</to></action>
+ <action name="DesktopNext"/>
</mousebind>
<mousebind button="C-A-Up" action="Click">
- <action name="GoToDesktop"><to>previous</to></action>
+ <action name="DesktopPrevious"/>
</mousebind>
<mousebind button="C-A-Down" action="Click">
- <action name="GoToDesktop"><to>next</to></action>
+ <action name="DesktopNext"/>
</mousebind>
<mousebind button="A-S-Up" action="Click">
- <action name="SendToDesktop"><to>previous</to></action>
+ <action name="SendToDesktopPrevious"/>
</mousebind>
<mousebind button="A-S-Down" action="Click">
- <action name="SendToDesktop"><to>next</to></action>
+ <action name="SendToDesktopNext"/>
</mousebind>
</context>
<action name="Move"/>
</mousebind>
<mousebind button="Left" action="DoubleClick">
- <action name="ToggleMaximize"/>
+ <action name="ToggleMaximizeFull"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
- <action name="Resize"><edge>bottomleft</edge></action>
+ <action name="Resize"/>
</mousebind>
</context>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
- <action name="Resize"><edge>bottomright</edge></action>
+ <action name="Resize"/>
</mousebind>
</context>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Drag">
- <action name="Resize"><edge>topleft</edge></action>
+ <action name="Resize"/>
</mousebind>
</context>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Drag">
- <action name="Resize"><edge>topright</edge></action>
+ <action name="Resize"/>
</mousebind>
</context>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
- <action name="ToggleMaximize"/>
+ <action name="ToggleMaximizeFull"/>
</mousebind>
<mousebind button="Middle" action="Click">
- <action name="ToggleMaximize"><direction>vertical</direction></action>
+ <action name="ToggleMaximizeVert"/>
</mousebind>
<mousebind button="Right" action="Click">
- <action name="ToggleMaximize"><direction>horizontal</direction></action>
+ <action name="ToggleMaximizeHorz"/>
</mousebind>
</context>
</context>
<context name="Desktop">
- <mousebind button="Up" action="Press">
- <action name="GoToDesktop"><to>previous</to></action>
+ <mousebind button="Up" action="Click">
+ <action name="DesktopPrevious"/>
</mousebind>
- <mousebind button="Down" action="Press">
- <action name="GoToDesktop"><to>next</to></action>
+ <mousebind button="Down" action="Click">
+ <action name="DesktopNext"/>
</mousebind>
- <mousebind button="A-Up" action="Press">
- <action name="GoToDesktop"><to>previous</to></action>
+ <mousebind button="A-Up" action="Click">
+ <action name="DesktopPrevious"/>
</mousebind>
- <mousebind button="A-Down" action="Press">
- <action name="GoToDesktop"><to>next</to></action>
+ <mousebind button="A-Down" action="Click">
+ <action name="DesktopNext"/>
</mousebind>
- <mousebind button="C-A-Up" action="Press">
- <action name="GoToDesktop"><to>previous</to></action>
+ <mousebind button="C-A-Up" action="Click">
+ <action name="DesktopPrevious"/>
</mousebind>
- <mousebind button="C-A-Down" action="Press">
- <action name="GoToDesktop"><to>next</to></action>
+ <mousebind button="C-A-Down" action="Click">
+ <action name="DesktopNext"/>
</mousebind>
<mousebind button="Left" action="Press">
</context>
<context name="MoveResize">
- <mousebind button="Up" action="Press">
- <action name="GoToDesktop"><to>previous</to></action>
+ <mousebind button="Up" action="Click">
+ <action name="DesktopPrevious"/>
</mousebind>
- <mousebind button="Down" action="Press">
- <action name="GoToDesktop"><to>next</to></action>
+ <mousebind button="Down" action="Click">
+ <action name="DesktopNext"/>
</mousebind>
- <mousebind button="A-Up" action="Press">
- <action name="GoToDesktop"><to>previous</to></action>
+ <mousebind button="A-Up" action="Click">
+ <action name="DesktopPrevious"/>
</mousebind>
- <mousebind button="A-Down" action="Press">
- <action name="GoToDesktop"><to>next</to></action>
+ <mousebind button="A-Down" action="Click">
+ <action name="DesktopNext"/>
</mousebind>
</context>
</mouse>
# this is an example with comments through out. use these to make your
# own rules, but without the comments of course.
- <application name="first element of window's WM_CLASS property (see xprop)"
- class="second element of window's WM_CLASS property (see xprop)"
- role="the window's WM_WINDOW_ROLE property (see xprop)"
- type="the window's _NET_WM_WINDOW_TYPE (if unspecified, then
- it is dialog for child windows)">
+ <application name="the window's _OB_NAME property (see obprop)"
+ class="the window's _OB_CLASS property (see obprop)"
+ role="the window's _OB_ROLE property (see obprop)"
+ type="the window's _NET_WM_WINDOW_TYPE (see obprob)..
+ (if unspecified, then it is 'dialog' for child windows)">
# the name or the class can be set, or both. this is used to match
# windows when they appear. role can optionally be set as well, to
# further restrict your matches.
#include "openbox/event.h"
#include "openbox/focus_cycle.h"
#include "openbox/openbox.h"
+#include "openbox/client.h"
#include "gettext.h"
typedef struct {
{
if (e->type == KeyPress) {
/* Escape cancels no matter what */
- if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) {
+ if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE)) {
end_cycle(TRUE, e->xkey.state, options);
return FALSE;
}
/* There were no modifiers and they pressed enter */
- else if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN) &&
+ else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) &&
!initial_state)
{
end_cycle(FALSE, e->xkey.state, options);
#include "openbox/window.h"
#include "openbox/focus_cycle.h"
#include "openbox/openbox.h"
+#include "openbox/client.h"
#include "openbox/misc.h"
#include "gettext.h"
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,
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)
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;
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;
}
{
if (e->type == KeyPress) {
/* Escape cancels no matter what */
- if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) {
+ if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE)) {
end_cycle(TRUE, e->xkey.state, options);
return FALSE;
}
/* There were no modifiers and they pressed enter */
- else if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN) &&
+ else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) &&
!initial_state)
{
end_cycle(FALSE, e->xkey.state, options);
static void client_get_all(ObClient *self, gboolean real);
static void client_get_startup_id(ObClient *self);
static void client_get_session_ids(ObClient *self);
+ static void client_save_session_ids(ObClient *self);
static void client_get_area(ObClient *self);
static void client_get_desktop(ObClient *self);
static void client_get_state(ObClient *self);
/* get the session related properties, these can change decorations
from per-app settings */
client_get_session_ids(self);
+ client_save_session_ids(self);
/* now we got everything that can affect the decorations */
if (!real)
*/
if (!self->icon_set && !self->parents) {
RrPixel32 *icon = ob_rr_theme->def_win_icon;
- gulong *ldata; /* use a long here to satisfy OBT_PROP_SETA32 */
+ gulong *ldata; /* use a long here to satisfy PROP_SETA32 */
w = ob_rr_theme->def_win_icon_w;
h = ob_rr_theme->def_win_icon_h;
}
}
+ /*! Save the session IDs as seen by Openbox when the window mapped, so that
+ users can still access them later if the app changes them */
+ static void client_save_session_ids(ObClient *self)
+ {
+ PROP_SETS(self->window, ob_role, self->role);
+ PROP_SETS(self->window, ob_name, self->name);
+ PROP_SETS(self->window, ob_class, self->class);
+ }
+
static void client_change_wm_state(ObClient *self)
{
gulong state[2];
GList *entries;
ObMenuEntryFrame *selected;
+ /* if a submenu was selected, then this holds the entry for that submenu
+ until it is closed */
+ ObMenuEntryFrame *open_submenu;
/* show entries from the menu starting at this index */
guint show_from;
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);
static gboolean restart = FALSE;
static gchar *restart_path = NULL;
static Cursor cursors[OB_NUM_CURSORS];
- static KeyCode keys[OB_NUM_KEYS];
+ static KeyCode *keys[OB_NUM_KEYS];
static gint exitcode = 0;
static guint remote_control = 0;
static gboolean being_replaced = FALSE;
event_shutdown(reconfigure);
config_shutdown();
actions_shutdown(reconfigure);
+
+ /* Free the key codes for built in keys */
+ g_free(keys[OB_KEY_RETURN]);
+ g_free(keys[OB_KEY_ESCAPE]);
+ g_free(keys[OB_KEY_LEFT]);
+ g_free(keys[OB_KEY_RIGHT]);
+ g_free(keys[OB_KEY_UP]);
+ g_free(keys[OB_KEY_DOWN]);
+ g_free(keys[OB_KEY_TAB]);
+ g_free(keys[OB_KEY_SPACE]);
+
modkeys_shutdown(reconfigure);
} while (reconfigure);
}
}
}
-static void print_version()
+static void print_version(void)
{
g_print("Openbox %s\n", PACKAGE_VERSION);
g_print(_("Copyright (c)"));
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"));
*argc -= num;
}
-static void parse_env()
+static void parse_env(void)
{
+ const gchar *id;
+
/* unset this so we don't pass it on unknowingly */
unsetenv("DESKTOP_STARTUP_ID");
+
+ /* this is how gnome-session passes in a session client id */
+ id = g_getenv("DESKTOP_AUTOSTART_ID");
+ if (id) {
+ unsetenv("DESKTOP_AUTOSTART_ID");
+ if (ob_sm_id) g_free(ob_sm_id);
+ ob_sm_id = g_strdup(id);
+ ob_debug_type(OB_DEBUG_SM,
+ "DESKTOP_AUTOSTART_ID %s supercedes --sm-client-id\n",
+ ob_sm_id);
+ }
}
static void parse_args(gint *argc, gchar **argv)
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);
ob_main_loop_exit(ob_main_loop);
}
-void ob_exit_replace()
+void ob_exit_replace(void)
{
exitcode = 0;
being_replaced = TRUE;
return cursors[cursor];
}
- KeyCode ob_keycode(ObKey key)
+ gboolean ob_keycode_match(KeyCode code, ObKey key)
{
+ KeyCode *k;
+
g_assert(key < OB_NUM_KEYS);
- return keys[key];
+ for (k = keys[key]; *k; ++k)
+ if (*k == code) return TRUE;
+ return FALSE;
}
-ObState ob_state()
+ObState ob_state(void)
{
return state;
}
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);
Cursor ob_cursor(ObCursor cursor);
- KeyCode ob_keycode(ObKey key);
+ gboolean ob_keycode_match(KeyCode code, ObKey key);
#endif
Atom ob_theme;
Atom ob_config_file;
Atom ob_control;
+ Atom ob_role;
+ Atom ob_name;
+ Atom ob_class;
} 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,
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);
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);
/*! 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.
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);
*/
guint screen_find_monitor(Rect *search);
+ /*! Finds the monitor which contains the point @x, @y */
+ guint screen_find_monitor_point(guint x, guint y);
+
/*! 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. */