/* if using focus_delay, stop the timer now so that focus doesn't go
moving on us, which would kill the action */
event_halt_focus_delay();
-
+
return TRUE;
}
else
Options *o = options;
guint d;
-
+
switch (o->type) {
case LAST:
/*
ob_debug("button %d focusable %d context %d %d %d\n",
data->button, client_mouse_focusable(data->client),
- data->context,
+ data->context,
OB_FRAME_CONTEXT_CLIENT, OB_FRAME_CONTEXT_FRAME);
*/
if (data->button == 0 || client_mouse_focusable(data->client) ||
/* get the client's size back */
w -= c->frame->size.left + c->frame->size.right;
- h -= c->frame->size.top + c->frame->size.bottom;
+ h -= c->frame->size.top + c->frame->size.bottom;
frame_frame_gravity(c->frame, &x, &y); /* get the client coords */
client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
-
+
client.c for the Openbox window manager
Copyright (c) 2006 Mikael Magnusson
Copyright (c) 2003-2007 Dana Jansens
grab_server(FALSE);
return; /* don't manage it */
}
-
+
/* is the window a docking app */
if ((wmhint = XGetWMHints(ob_display, window))) {
if ((wmhint->flags & StateHint) &&
frame_adjust_area(self->frame, FALSE, TRUE, TRUE);
ob_debug("gave extents left %d right %d top %d bottom %d\n",
- self->frame->size.left, self->frame->size.right,
+ self->frame->size.left, self->frame->size.right,
self->frame->size.top, self->frame->size.bottom);
/* free the ObAppSettings shallow copy */
if (self->type == OB_CLIENT_TYPE_DESKTOP)
self->desktop = DESKTOP_ALL;
}
-
+
#ifdef SYNC
client_update_sync_request_counter(self);
#endif
{
XWindowAttributes wattrib;
Status ret;
-
+
ret = XGetWindowAttributes(ob_display, self->window, &wattrib);
g_assert(ret != BadWindow);
self->desktop = screen_num_desktops - 1;
else
self->desktop = d;
- ob_debug("client requested desktop 0x%x\n", self->desktop);
+ ob_debug("client requested desktop 0x%x\n", self->desktop);
} else {
GSList *it;
gboolean first = TRUE;
{
guint32 *state;
guint num;
-
+
if (PROP_GETA32(self->window, net_wm_state, atom, &state, &num)) {
gulong i;
for (i = 0; i < num; ++i) {
self->transient_for_group, trangroup,
client_direct_parent(self), target);
self->transient_for_group = trangroup;
-
+
}
static void client_update_transient_tree(ObClient *self,
self->type = -1;
self->transient = FALSE;
-
+
if (PROP_GETA32(self->window, net_wm_window_type, atom, &val, &num)) {
/* use the first value that we know about in the array */
for (i = 0; i < num; ++i) {
if (XGetTransientForHint(ob_display, self->window, &t))
self->transient = TRUE;
-
+
if (self->type == (ObClientType) -1) {
/*the window type hint was not set, which means we either classify
ourself as a normal window or a dialog, depending on if we are a
notified whenever we want it to receive focus */
self->focus_notify = TRUE;
#ifdef SYNC
- else if (proto[i] == prop_atoms.net_wm_sync_request)
+ else if (proto[i] == prop_atoms.net_wm_sync_request)
/* if this protocol is requested, then resizing the
window will be synchronized between the frame and the
client */
if (size.flags & PMinSize)
SIZE_SET(self->min_size, size.min_width, size.min_height);
-
+
if (size.flags & PMaxSize)
SIZE_SET(self->max_size, size.max_width, size.max_height);
-
+
if (size.flags & PBaseSize)
SIZE_SET(self->base_size, size.base_width, size.base_height);
-
+
if (size.flags & PResizeInc && size.width_inc && size.height_inc)
SIZE_SET(self->size_inc, size.width_inc, size.height_inc);
/* assume a window takes input if it doesnt specify */
self->can_focus = TRUE;
-
+
if ((hints = XGetWMHints(ob_display, self->window)) != NULL) {
gboolean ur;
gchar *visible = NULL;
g_free(self->title);
-
+
/* try netwm */
if (!PROP_GETS(self->window, net_wm_name, utf8, &data)) {
/* try old x stuff */
}
self->icons = g_new(ObClientIcon, self->nicons);
-
+
/* store the icons */
i = 0;
for (j = 0; j < self->nicons; ++j) {
or removes it entirely, it's not very likely it is going to set one
right away afterwards
- if it has parents, then one of them will have an icon already
+ if it has parents, then one of them will have an icon already
*/
if (self->nicons == 0 && !self->parents) {
RrPixel32 *icon = ob_rr_theme->def_win_icon;
return FALSE;
if (self->desktop == screen_desktop || self->desktop == DESKTOP_ALL)
return TRUE;
-
+
return FALSE;
}
client_shade(self, TRUE);
if (demands_attention)
client_hilite(self, TRUE);
-
+
if (max_vert && max_horz)
client_maximize(self, TRUE, 0);
else if (max_vert)
/* you cannot resize to nothing */
if (basew + *w < 1) *w = 1 - basew;
if (baseh + *h < 1) *h = 1 - baseh;
-
+
/* save the logical size */
*logicalw = incw > 1 ? *w : *w + basew;
*logicalh = inch > 1 ? *h : *h + baseh;
void client_maximize(ObClient *self, gboolean max, gint dir)
{
gint x, y, w, h;
-
+
g_assert(dir == 0 || dir == 1 || dir == 2);
if (!(self->functions & OB_CLIENT_FUNC_MAXIMIZE)) return; /* can't */
close, we just kill it */
if (!self->delete_window)
client_kill(self);
-
+
/*
XXX: itd be cool to do timeouts and shit here for killing the client's
process off
{
GSList *it;
ObClient *ret;
-
+
for (it = self->transients; it; it = g_slist_next(it)) {
ObClient *c = it->data;
if ((ret = client_search_modal_child(c))) return ret;
gboolean client_validate(ObClient *self)
{
- XEvent e;
+ XEvent e;
XSync(ob_display, FALSE); /* get all events on the server */
void client_set_wm_state(ObClient *self, glong state)
{
if (state == self->wmstate) return; /* no change */
-
+
switch (state) {
case IconicState:
client_iconify(self, TRUE, TRUE, FALSE);
action == prop_atoms.net_wm_state_remove ||
action == prop_atoms.net_wm_state_toggle))
/* an invalid action was passed to the client message, ignore it */
- return;
+ return;
for (i = 0; i < 2; ++i) {
Atom state = i == 0 ? data1 : data2;
-
+
if (!state) continue;
/* if toggling, then pick whether we're adding or removing */
action = undecorated ? prop_atoms.net_wm_state_remove :
prop_atoms.net_wm_state_add;
}
-
+
if (action == prop_atoms.net_wm_state_add) {
if (state == prop_atoms.net_wm_state_modal) {
modal = TRUE;
if ((parent = client_icon_recursive(c, w, h)))
break;
}
-
+
return parent;
}
void client_set_undecorated(ObClient *self, gboolean undecorated)
{
if (self->undecorated != undecorated &&
- /* don't let it undecorate if the function is missing, but let
+ /* don't let it undecorate if the function is missing, but let
it redecorate */
(self->functions & OB_CLIENT_FUNC_UNDECORATE || !undecorated))
{
if (!self->parents) return NULL;
if (self->transient_for_group) return NULL;
return self->parents->data;
-}
+}
ObClient *client_search_top_direct_parent(ObClient *self)
{
{
GSList *ret;
ObClient *p;
-
+
/* move up the direct transient chain as far as possible */
while ((p = client_direct_parent(self)) &&
(!bylayer || p->layer == layer))
gint height;
RrPixel32 *data;
};
-
+
/*! Possible window types */
typedef enum
{
window placement. In theory, where this window exists.
*/
StrutPartial strut;
-
+
/*! The logical size of the window
The "logical" size of the window is refers to the user's perception of
the size of the window, and is the value that should be displayed to the
A value of 0 means this is ignored.
*/
gfloat max_ratio;
-
+
/*! The minimum size of the client window
If the min is > the max, then the window is not resizable
*/
/*! The client's specified colormap */
Colormap colormap;
-
+
/*! Where to place the decorated window in relation to the undecorated
window */
gint gravity;
/*! True if the client supports the delete_window protocol */
gboolean delete_window;
-
+
/*! Was the window's position requested by the application or the user?
if by the application, we force it completely onscreen, if by the user
we only force it if it tries to go completely offscreen, if neither, we
/*! Was the window's size requested by the application or the user?
If by the application we don't let it go outside the available area */
guint sized;
-
+
/*! Can the window receive input focus? */
gboolean can_focus;
/*! Notify the window when it receives focus? */
menu_free(desktop_menus->data);
desktop_menus = g_slist_delete_link(desktop_menus, desktop_menus);
}
-
+
for (i = 0; i < screen_num_desktops; ++i) {
ObMenu *submenu;
gchar *name = g_strdup_printf("%s-%u", MENU_NAME, i);
menu_set_execute_func(menu, client_menu_execute);
e = menu_add_normal(menu, CLIENT_RESTORE, _("R_estore"), NULL, TRUE);
- e->data.normal.mask = ob_rr_theme->max_toggled_mask;
+ e->data.normal.mask = ob_rr_theme->max_toggled_mask;
e->data.normal.mask_normal_color = ob_rr_theme->menu_color;
e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color;
e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color;
ob_rr_theme->menu_disabled_selected_color;
e = menu_add_normal(menu, CLIENT_MAXIMIZE, _("Ma_ximize"), NULL, TRUE);
- e->data.normal.mask = ob_rr_theme->max_mask;
+ e->data.normal.mask = ob_rr_theme->max_mask;
e->data.normal.mask_normal_color = ob_rr_theme->menu_color;
e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color;
e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color;
if (class_set || name_set) {
xmlNodePtr n, c;
ObAppSettings *settings = config_create_app_settings();;
-
+
if (name_set)
settings->name = g_pattern_spec_new(name);
config_per_app_settings = g_slist_append(config_per_app_settings,
(gpointer) settings);
}
-
+
app = parse_find_node("application", app->next);
}
else if ((n = parse_find_node("action", node->children))) {
while (n) {
ObActionsAct *action;
-
+
action = actions_parse(i, doc, n);
if (action)
keyboard_bind(keylist, action);
/*
-<context name="Titlebar">
+<context name="Titlebar">
<mousebind button="Left" action="Press">
<action name="Raise"></action>
</mousebind>
mouse_unbind_all();
node = node->children;
-
+
if ((n = parse_find_node("dragThreshold", node)))
config_mouse_threshold = parse_int(doc, n);
if ((n = parse_find_node("doubleClickTime", node)))
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("focusNew", node)))
config_focus_new = parse_bool(doc, n);
if ((n = parse_find_node("followMouse", node)))
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("policy", node)))
if (parse_contains("UnderMouse", doc, n))
config_place_policy = OB_PLACE_POLICY_MOUSE;
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("top", node)))
config_margins.top = MAX(0, parse_int(doc, n));
if ((n = parse_find_node("left", node)))
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("number", node))) {
gint d = parse_int(doc, n);
if (d > 0)
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("drawContents", node)))
config_resize_redraw = parse_bool(doc, n);
if ((n = parse_find_node("popupShow", node))) {
config_menu_client_list_icons = parse_bool(doc, n);
}
}
-
-static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+
+static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
gpointer d)
{
xmlNodePtr n;
if (data[1])
app->class = g_strdup(data[1]);
}
- g_strfreev(data);
+ g_strfreev(data);
}
if (app->name == NULL) app->name = g_strdup("");
if (app->class == NULL) app->class = g_strdup("");
-
+
if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) {
app->w = attrib.width;
app->h = attrib.height;
break;
}
break;
- }
+ }
}
}
xwc.border_width = e->xconfigurerequest.border_width;
xwc.sibling = e->xconfigurerequest.above;
xwc.stack_mode = e->xconfigurerequest.detail;
-
+
/* we are not to be held responsible if someone sends us an
invalid request! */
xerror_set_ignore(TRUE);
static void event_handle_root(XEvent *e)
{
Atom msgtype;
-
+
switch(e->type) {
case SelectionClear:
ob_debug("Another WM has requested to replace us. Exiting.\n");
ObFrameContext con;
static gint px = -1, py = -1;
static guint pb = 0;
-
+
switch (e->type) {
case ButtonPress:
/* save where the press occured for the first button pressed */
case OB_FRAME_CONTEXT_ALLDESKTOPS:
client->frame->desk_press = (e->type == ButtonPress);
frame_adjust_state(client->frame);
- break;
+ break;
case OB_FRAME_CONTEXT_SHADE:
client->frame->shade_press = (e->type == ButtonPress);
frame_adjust_state(client->frame);
/* we don't want the reparent event, put it back on the stack for the
X server to deal with after we unmanage the window */
XPutBackEvent(ob_display, e);
-
+
ob_debug("ReparentNotify for window 0x%x\n", client->window);
client_unmanage(client);
break;
case PropertyNotify:
/* validate cuz we query stuff off the client here */
if (!client_validate(client)) break;
-
+
/* compress changes to a single property into a single change */
while (XCheckTypedWindowEvent(ob_display, client->window,
e->type, &ce)) {
menu_frame_select(e->frame, NULL, FALSE);
}
break;
- case MotionNotify:
- if ((e = menu_entry_frame_under(ev->xmotion.x_root,
+ case MotionNotify:
+ if ((e = menu_entry_frame_under(ev->xmotion.x_root,
ev->xmotion.y_root)))
if (!(f = find_active_menu()) ||
f == e->frame ||
extensions.c for the Openbox window manager
Copyright (c) 2006 Mikael Magnusson
Copyright (c) 2003-2007 Dana Jansens
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
See the COPYING file for a copy of the GNU General Public License.
*/
{
gint junk;
(void)junk;
-
+
#ifdef XKB
extensions_xkb =
XkbQueryExtension(ob_display, &junk, &extensions_xkb_event_basep,
void extensions_query_all();
void extensions_xinerama_screens(Rect **areas, guint *nxin);
-
+
#endif
static gboolean focus_target_has_siblings(ObClient *ft,
gboolean iconic_windows,
gboolean all_desktops)
-
+
{
GSList *it;
ok = ok && ((dock_windows && ft->type == OB_CLIENT_TYPE_DOCK) ||
(desktop_windows && ft->type == OB_CLIENT_TYPE_DESKTOP));
/* modal windows are important and can always get focus if they are
- visible and stuff, so don't change 'ok' based on their type */
+ visible and stuff, so don't change 'ok' based on their type */
else if (!ft->modal)
/* normal non-helper windows are valid targets */
ok = ok &&
include helper windows ... */
((focus_client && ft->group == focus_client->group &&
helper_windows) ||
- /* ... or if there are no other windows in its group
+ /* ... or if there are no other windows in its group
that can be focused instead */
!focus_target_has_siblings(ft, iconic_windows, all_desktops))));
/* this be mostly ripped from fvwm */
static ObClient *focus_find_directional(ObClient *c, ObDirection dir,
gboolean dock_windows,
- gboolean desktop_windows)
+ gboolean desktop_windows)
{
gint my_cx, my_cy, his_cx, his_cy;
gint offset = 0;
focus_cycle_desktop_windows))
ft = it->data;
}
-
+
if (ft && ft != focus_cycle_target) {/* prevents flicker */
focus_cycle_target = ft;
if (!interactive)
return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0,
RrDepth(ob_rr_inst), InputOutput,
RrVisual(ob_rr_inst), mask, attrib);
-
+
}
void focus_cycle_indicator_startup(gboolean reconfig)
(visual ? 32 : RrDepth(ob_rr_inst)), InputOutput,
(visual ? visual : RrVisual(ob_rr_inst)),
mask, attrib);
-
+
}
static Visual *check_32bit_client(ObClient *c)
self->handle = createWindow(self->window, NULL, mask, &attrib);
self->lgrip = createWindow(self->handle, NULL, mask, &attrib);
- self->rgrip = createWindow(self->handle, NULL, mask, &attrib);
+ self->rgrip = createWindow(self->handle, NULL, mask, &attrib);
self->handleleft = createWindow(self->handle, NULL, mask, &attrib);
self->handleright = createWindow(self->handle, NULL, mask, &attrib);
XMapWindow(ob_display, self->backback);
XMapWindow(ob_display, self->backfront);
- self->max_press = self->close_press = self->desk_press =
+ self->max_press = self->close_press = self->desk_press =
self->iconify_press = self->shade_press = FALSE;
- self->max_hover = self->close_hover = self->desk_hover =
+ self->max_hover = self->close_hover = self->desk_hover =
self->iconify_hover = self->shade_hover = FALSE;
set_theme_statics(self);
static void free_theme_statics(ObFrame *self)
{
- RrAppearanceFree(self->a_unfocused_title);
+ RrAppearanceFree(self->a_unfocused_title);
RrAppearanceFree(self->a_focused_title);
RrAppearanceFree(self->a_unfocused_label);
RrAppearanceFree(self->a_focused_label);
{
self->size.bottom += ob_rr_theme->handle_height + self->bwidth;
}
-
+
/* position/size and map/unmap all the windows */
if (!fake) {
sidebwidth) * 2,
self->bwidth);
-
+
if (sidebwidth) {
XMoveResizeWindow(ob_display, self->lgripleft,
0,
if (!frame_iconify_animating(self))
/* move and resize the top level frame.
shading can change without being moved or resized.
-
+
but don't do this during an iconify animation. it will be
reflected afterwards.
*/
flash_done);
g_get_current_time(&self->flash_end);
g_time_val_add(&self->flash_end, G_USEC_PER_SEC * 5);
-
+
self->flashing = TRUE;
}
/* how far do we have left to go ? */
g_get_current_time(&now);
time = frame_animate_iconify_time_left(self, &now);
-
+
if (time == 0 || iconifying) {
/* start where the frame is supposed to be */
x = self->area.x;
(self->max_press ?
ob_rr_theme->a_toggled_focused_pressed_max :
(self->max_hover ?
- ob_rr_theme->a_toggled_hover_focused_max :
+ ob_rr_theme->a_toggled_hover_focused_max :
ob_rr_theme->a_toggled_focused_unpressed_max)) :
(self->max_press ?
ob_rr_theme->a_focused_pressed_max :
(self->max_hover ?
- ob_rr_theme->a_hover_focused_max :
+ ob_rr_theme->a_hover_focused_max :
ob_rr_theme->a_focused_unpressed_max))));
n = self->a_icon;
i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ?
(self->iconify_press ?
ob_rr_theme->a_focused_pressed_iconify :
(self->iconify_hover ?
- ob_rr_theme->a_hover_focused_iconify :
+ ob_rr_theme->a_hover_focused_iconify :
ob_rr_theme->a_focused_unpressed_iconify)));
d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ?
ob_rr_theme->a_disabled_focused_desk :
(self->desk_press ?
ob_rr_theme->a_toggled_focused_pressed_desk :
(self->desk_hover ?
- ob_rr_theme->a_toggled_hover_focused_desk :
+ ob_rr_theme->a_toggled_hover_focused_desk :
ob_rr_theme->a_toggled_focused_unpressed_desk)) :
(self->desk_press ?
ob_rr_theme->a_focused_pressed_desk :
(self->desk_hover ?
- ob_rr_theme->a_hover_focused_desk :
+ ob_rr_theme->a_hover_focused_desk :
ob_rr_theme->a_focused_unpressed_desk))));
s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ?
ob_rr_theme->a_disabled_focused_shade :
(self->shade_press ?
ob_rr_theme->a_toggled_focused_pressed_shade :
(self->shade_hover ?
- ob_rr_theme->a_toggled_hover_focused_shade :
+ ob_rr_theme->a_toggled_hover_focused_shade :
ob_rr_theme->a_toggled_focused_unpressed_shade)) :
(self->shade_press ?
ob_rr_theme->a_focused_pressed_shade :
(self->shade_hover ?
- ob_rr_theme->a_hover_focused_shade :
+ ob_rr_theme->a_hover_focused_shade :
ob_rr_theme->a_focused_unpressed_shade))));
c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ?
ob_rr_theme->a_disabled_focused_close :
(self->close_press ?
ob_rr_theme->a_focused_pressed_close :
(self->close_hover ?
- ob_rr_theme->a_hover_focused_close :
+ ob_rr_theme->a_hover_focused_close :
ob_rr_theme->a_focused_unpressed_close)));
} else {
t = self->a_unfocused_title;
(self->max_press ?
ob_rr_theme->a_toggled_unfocused_pressed_max :
(self->max_hover ?
- ob_rr_theme->a_toggled_hover_unfocused_max :
+ ob_rr_theme->a_toggled_hover_unfocused_max :
ob_rr_theme->a_toggled_unfocused_unpressed_max)) :
(self->max_press ?
ob_rr_theme->a_unfocused_pressed_max :
(self->max_hover ?
- ob_rr_theme->a_hover_unfocused_max :
+ ob_rr_theme->a_hover_unfocused_max :
ob_rr_theme->a_unfocused_unpressed_max))));
n = self->a_icon;
i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ?
(self->iconify_press ?
ob_rr_theme->a_unfocused_pressed_iconify :
(self->iconify_hover ?
- ob_rr_theme->a_hover_unfocused_iconify :
+ ob_rr_theme->a_hover_unfocused_iconify :
ob_rr_theme->a_unfocused_unpressed_iconify)));
d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ?
ob_rr_theme->a_disabled_unfocused_desk :
(self->desk_press ?
ob_rr_theme->a_toggled_unfocused_pressed_desk :
(self->desk_hover ?
- ob_rr_theme->a_toggled_hover_unfocused_desk :
+ ob_rr_theme->a_toggled_hover_unfocused_desk :
ob_rr_theme->a_toggled_unfocused_unpressed_desk)) :
(self->desk_press ?
ob_rr_theme->a_unfocused_pressed_desk :
(self->desk_hover ?
- ob_rr_theme->a_hover_unfocused_desk :
+ ob_rr_theme->a_hover_unfocused_desk :
ob_rr_theme->a_unfocused_unpressed_desk))));
s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ?
ob_rr_theme->a_disabled_unfocused_shade :
(self->shade_press ?
ob_rr_theme->a_toggled_unfocused_pressed_shade :
(self->shade_hover ?
- ob_rr_theme->a_toggled_hover_unfocused_shade :
+ ob_rr_theme->a_toggled_hover_unfocused_shade :
ob_rr_theme->a_toggled_unfocused_unpressed_shade)) :
(self->shade_press ?
ob_rr_theme->a_unfocused_pressed_shade :
(self->shade_hover ?
- ob_rr_theme->a_hover_unfocused_shade :
+ ob_rr_theme->a_hover_unfocused_shade :
ob_rr_theme->a_unfocused_unpressed_shade))));
c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ?
ob_rr_theme->a_disabled_unfocused_close :
(self->close_press ?
ob_rr_theme->a_unfocused_pressed_close :
(self->close_hover ?
- ob_rr_theme->a_hover_unfocused_close :
+ ob_rr_theme->a_hover_unfocused_close :
ob_rr_theme->a_unfocused_unpressed_close)));
}
clear = ob_rr_theme->a_clear;
gboolean chroot;
/* the level up in the tree */
- struct KeyBindingTree *parent;
+ struct KeyBindingTree *parent;
/* the next binding in the tree at the same level */
- struct KeyBindingTree *next_sibling;
+ struct KeyBindingTree *next_sibling;
/* the first child of this binding (next binding in a chained sequence).*/
struct KeyBindingTree *first_child;
} KeyBindingTree;
if ((r = b->tv_sec - a->tv_sec)) return r;
return b->tv_usec - a->tv_usec;
-
+
}
static void insert_timer(ObMainLoop *loop, ObMainLoopTimer *ins)
for (it = loop->timers; it; it = next) {
ObMainLoopTimer *curr;
-
+
next = g_slist_next(it);
curr = it->data;
*/
if (curr->del_me) {
/* delete the top */
- loop->timers = g_slist_delete_link(loop->timers, it);
+ loop->timers = g_slist_delete_link(loop->timers, it);
if (curr->destroy)
curr->destroy(curr->data);
g_free(curr);
continue;
}
- /* the queue is sorted, so if this timer shouldn't fire, none are
+ /* the queue is sorted, so if this timer shouldn't fire, none are
ready */
if (timecompare(&NEAREST_TIMEOUT(loop), &loop->now) < 0)
break;
g_message(_("Unable to find a valid menu file '%s'"),
"menu.xml");
}
-
+
g_assert(menu_parse_state.parent == NULL);
if (!reconfig)
g_message(_("Attempted to access menu '%s' but it does not exist"),
name);
return self;
-}
+}
#define VALID_SHORTCUT(c) (((c) >= '0' && (c) <= '9') || \
((c) >= 'A' && (c) <= 'Z') || \
gboolean *always_show)
{
gunichar shortcut = 0;
-
+
*position = 0;
*always_show = FALSE;
{
ObMenuParseState *state = data;
gchar *label;
-
+
if (state->parent) {
if (parse_attr_string("label", node, &label)) {
GSList *acts = NULL;
if (self->entry->data.separator.label != NULL) {
h += ob_rr_theme->menu_title_height +
(ob_rr_theme->mbwidth - PADDING) * 2;
-
+
/* if the first entry is a labeled separator, then make its border
overlap with the menu's outside border */
if (first_entry)
more_frame = menu_entry_frame_new(more_entry, self);
/* make it get deleted when the menu frame goes away */
menu_entry_unref(more_entry);
-
+
/* add our More... entry to the frame */
self->entries = g_list_append(self->entries, more_frame);
}
entry = old;
if (old == entry) return;
-
- if (config_submenu_show_delay) {
+
+ if (config_submenu_show_delay) {
/* remove any submenu open requests */
ob_main_loop_timeout_remove(ob_main_loop,
menu_entry_frame_submenu_timeout);
{
gint i;
GSList *it;
-
+
for(i = 0; i < OB_FRAME_NUM_CONTEXTS; ++i) {
for (it = bound_contexts[i]; it; it = g_slist_next(it)) {
ObMouseBinding *b = it->data;
static void client_dest(ObClient *client, gpointer data)
{
if (moveresize_client == client)
- moveresize_end(TRUE);
+ moveresize_end(TRUE);
}
void moveresize_startup(gboolean reconfig)
pdy = -dh;
else if (key_resize_edge == OB_DIRECTION_SOUTH)
pdy = dh;
-
+
screen_pointer_pos(&opx, &opy);
XWarpPointer(ob_display, None, None, 0, 0, 0, 0, pdx, pdy);
/* steal the motion events this causes */
dw = (e->xmotion.x_root - start_x);
dh = -(e->xmotion.y_root - start_y);
lockcorner = OB_CORNER_BOTTOMLEFT;
- } else if (corner == prop_atoms.net_wm_moveresize_size_right) {
+ } else if (corner == prop_atoms.net_wm_moveresize_size_right) {
dw = (e->xmotion.x_root - start_x);
dh = 0;
lockcorner = OB_CORNER_BOTTOMLEFT;
if (chdir(g_get_home_dir()) == -1)
g_message(_("Unable to change to home directory '%s': %s"),
g_get_home_dir(), g_strerror(errno));
-
+
/* parse the command line args, which can change the argv[0] */
parse_args(&argc, argv);
/* parse the environment variables */
prop_startup();
/* Send client message telling the OB process to:
- * remote_control = 1 -> reconfigure
+ * remote_control = 1 -> reconfigure
* remote_control = 2 -> restart */
PROP_MSG(RootWindow(ob_display, ob_screen),
ob_control, remote_control, 0, 0, 0);
g_free(ob_sm_save_file);
g_free(ob_sm_id);
g_free(program_name);
-
+
return exitcode;
}
break;
case SIGUSR2:
ob_debug("Caught signal %d. Reconfiguring.\n", signal);
- ob_reconfigure();
+ ob_reconfigure();
break;
case SIGCHLD:
/* reap children */
extern struct _ObMainLoop *ob_main_loop;
/*! The X display */
-extern Display *ob_display;
+extern Display *ob_display;
/*! The number of the screen on which we're running */
extern gint ob_screen;
/* try on the client's desktop */
for (it = c->group->members; it; it = g_slist_next(it)) {
- ObClient *itc = it->data;
+ ObClient *itc = it->data;
if (itc != c &&
(itc->desktop == c->desktop ||
itc->desktop == DESKTOP_ALL || c->desktop == DESKTOP_ALL))
/* try on all desktops */
for (it = c->group->members; it; it = g_slist_next(it)) {
- ObClient *itc = it->data;
+ ObClient *itc = it->data;
if (itc != c) {
add_choice(choice, client_monitor(it->data));
ob_debug("placement adding choice %d for group sibling on "
}
}
if (!first) {
- *x = ((r + 1 - l) - client->frame->area.width) / 2 + l;
+ *x = ((r + 1 - l) - client->frame->area.width) / 2 + l;
*y = ((b + 1 - t) - client->frame->area.height) / 2 + t;
return TRUE;
}
0, 0, 1, 1, 0, RrDepth(ob_rr_inst),
InputOutput, RrVisual(ob_rr_inst),
CWOverrideRedirect, &attrib);
-
+
self->text = XCreateWindow(ob_display, self->bg,
0, 0, 1, 1, 0, RrDepth(ob_rr_inst),
InputOutput, RrVisual(ob_rr_inst), 0, NULL);
self->a_text->texture[0].data.text.string = text;
self->textw = RrMinWidth(self->a_text);
} else
- self->textw = 0;
+ self->textw = 0;
}
void popup_height_to_string(ObPopup *self, gchar *text)
static gboolean popup_show_timeout(gpointer data)
{
ObPopup *self = data;
-
+
XMapWindow(ob_display, self->bg);
stacking_raise(INTERNAL_AS_WINDOW(self));
self->mapped = TRUE;
RECT_SET(mon, self->x, self->y, 1, 1);
area = screen_physical_area_monitor(screen_find_monitor(&mon));
- /* when there is no icon and the text is not parent relative, then
+ /* when there is no icon and the text is not parent relative, then
fill the whole dialog with the text appearance, don't use the bg at all
*/
if (self->hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
x=MAX(MIN(x, area->width-w),0);
y=MAX(MIN(y, area->height-h),0);
-
+
/* set the windows/appearances up */
XMoveResizeWindow(ob_display, self->bg, x, y, w, h);
- /* when there is no icon and the text is not parent relative, then
+ /* when there is no icon and the text is not parent relative, then
fill the whole dialog with the text appearance, don't use the bg at all
*/
if (self->hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
for (i = self->desks; i < screen_num_desktops; ++i) {
XSetWindowAttributes attr;
- attr.border_pixel =
+ attr.border_pixel =
RrColorPixel(ob_rr_theme->osd_border_color);
self->wins[i] = XCreateWindow(ob_display, self->popup->bg,
0, 0, 1, 1, ob_rr_theme->obwidth,
guint iconhm; /* icon height multiplier. multipled by the normal height */
gboolean mapped;
gboolean delay_mapped;
-
+
void (*draw_icon)(gint x, gint y, gint w, gint h, gpointer data);
gpointer draw_icon_data;
};
CREATE(utf8, "UTF8_STRING");
CREATE(manager, "MANAGER");
-
+
CREATE(wm_colormap_windows, "WM_COLORMAP_WINDOWS");
CREATE(wm_protocols, "WM_PROTOCOLS");
CREATE(wm_state, "WM_STATE");
CREATE(net_wm_state_above, "_NET_WM_STATE_ABOVE");
CREATE(net_wm_state_below, "_NET_WM_STATE_BELOW");
CREATE(net_wm_state_demands_attention, "_NET_WM_STATE_DEMANDS_ATTENTION");
-
+
prop_atoms.net_wm_state_add = 1;
prop_atoms.net_wm_state_remove = 0;
prop_atoms.net_wm_state_toggle = 2;
gchar *raw;
gchar *str;
guint num;
-
+
if (get_all(win, prop, prop_atoms.utf8, 8, (guchar**)&raw, &num)) {
str = g_strndup(raw, num); /* grab the first string from the list */
g_free(raw);
/* Atoms that are used inside messages - these don't go in net_supported */
- Atom net_wm_moveresize_size_topleft;
+ Atom net_wm_moveresize_size_topleft;
Atom net_wm_moveresize_size_top;
Atom net_wm_moveresize_size_topright;
Atom net_wm_moveresize_size_right;
*/
/* Openbox specific atoms */
-
+
Atom ob_wm_action_undecorate;
Atom ob_wm_state_undecorated;
Atom openbox_pid; /* this is depreecated in favour of ob_control */
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
-
+
propwin.c for the Openbox window manager
Copyright (c) 2006 Mikael Magnusson
Copyright (c) 2003-2007 Dana Jansens
ct = RECT_TOP(c->frame->area);
cr = RECT_RIGHT(c->frame->area);
cb = RECT_BOTTOM(c->frame->area);
-
+
for (it = stacking_list; it; it = g_list_next(it)) {
ObClient *target;
gint tl, tt, tr, tb; /* 1 past the target's edges on each side */
target = it->data;
/* don't snap to self or non-visibles */
- if (!target->frame->visible || target == c) continue;
+ if (!target->frame->visible || target == c) continue;
/* don't snap to windows set to below and skip_taskbar (desklets) */
if (target->below && !c->below && target->skip_taskbar) continue;
cb = RECT_BOTTOM(c->frame->area);
RECT_SET(desired_area, *x, *y, c->area.width, c->area.height);
-
+
for (i = 0; i < screen_num_monitors; ++i) {
parea = screen_physical_area_monitor(i);
target = it->data;
/* don't snap to invisibles or ourself */
- if (!target->frame->visible || target == c) continue;
+ if (!target->frame->visible || target == c) continue;
/* don't snap to windows set to below and skip_taskbar (desklets) */
if (target->below && !c->below && target->skip_taskbar) continue;
gint l, t, r, b; /* my left, top, right and bottom sides */
gint dlt, drb; /* my destination left/top and right/bottom sides */
Rect *area, *parea;
- gint al, at, ar, ab; /* screen boundaries */
+ gint al, at, ar, ab; /* screen boundaries */
gint pl, pt, pr, pb; /* physical screen boundaries */
gint incw, inch;
guint i;
stacking_raise(CLIENT_AS_WINDOW(c));
}
}
-
+
/* change our struts/area to match (after moving windows) */
screen_update_areas();
guint old;
gulong ignore_start;
gboolean allow_omni;
-
+
g_assert(num < screen_num_desktops);
old = screen_desktop;
if (PROP_GETA32(RootWindow(ob_display, ob_screen),
net_desktop_layout, cardinal, &data, &num)) {
if (num == 3 || num == 4) {
-
+
if (data[0] == prop_atoms.net_wm_orientation_vert)
l.orientation = OB_ORIENTATION_VERT;
else if (data[0] == prop_atoms.net_wm_orientation_horz)
void screen_show_desktop(gboolean show, ObClient *show_only)
{
GList *it;
-
+
if (show == screen_showing_desktop) return; /* no change */
screen_showing_desktop = show;
g_free(m);
}
-
+
return a;
}
#endif
static void sm_shutdown_cancelled(SmcConn conn, SmPointer data)
{
- ob_debug_type(OB_DEBUG_SM, "Shutdown cancelled\n");
+ ob_debug_type(OB_DEBUG_SM, "Shutdown cancelled\n");
}
static gboolean session_save_to_file(const ObSMSaveData *savedata)
parse_find_node("undecorated", node->children) != NULL;
state->focused =
parse_find_node("focused", node->children) != NULL;
-
+
/* save this. they are in the file in stacking order, so preserve
that order here */
session_saved_state = g_list_append(session_saved_state, state);
}
static GList *find_highest_relative(ObClient *client)
-{
+{
GList *ret = NULL;
if (client->parents) {
/* only look at windows in the same layer and that are
visible */
if (c->layer == client->layer &&
- !c->iconic &&
+ !c->iconic &&
(c->desktop == client->desktop ||
c->desktop == DESKTOP_ALL ||
client->desktop == DESKTOP_ALL))
gboolean ret = FALSE;
parsed = g_strsplit(str, "-", -1);
-
+
/* first, find the button (last token) */
l = NULL;
for (i = 0; parsed[i] != NULL; ++i)
KeySym sym;
parsed = g_strsplit(str, "-", -1);
-
+
/* first, find the key (last token) */
l = NULL;
for (i = 0; parsed[i] != NULL; ++i)
*keycode = XKeysymToKeycode(ob_display, sym);
}
if (!*keycode) {
- g_message(_("Requested key '%s' does not exist on the display"), l);
+ g_message(_("Requested key '%s' does not exist on the display"), l);
goto translation_fail;
}
xdg_config_dir_paths = slist_path_add(xdg_config_dir_paths,
g_strdup(xdg_config_home_path),
(GSListFunc) g_slist_prepend);
-
+
path = g_getenv("XDG_DATA_DIRS");
if (path && path[0] != '\0') /* not unset or empty */
xdg_data_dir_paths = split_paths(path);
}
data += im->width;
p32 += im->width;
- }
+ }
} else im->data = (gchar*) data;
break;
case 16:
break;
default:
g_error("Your bit depth is currently unhandled\n");
-
+
}
}
-XColor *RrPickColor(const RrInstance *inst, gint r, gint g, gint b)
+XColor *RrPickColor(const RrInstance *inst, gint r, gint g, gint b)
{
r = (r & 0xff) >> (8-RrPseudoBPC(inst));
g = (g & 0xff) >> (8-RrPseudoBPC(inst));
pango_layout_get_pixel_extents(t->font->layout, NULL, &rect);
mw = rect.width;
- /* pango_layout_set_alignment doesn't work with
+ /* pango_layout_set_alignment doesn't work with
pango_xft_render_layout_line */
switch (t->justify) {
case RR_JUSTIFY_LEFT:
struct _RrFont {
const RrInstance *inst;
gint ref;
- PangoFontDescription *font_desc;
+ PangoFontDescription *font_desc;
PangoLayout *layout; /*!< Used for measuring and rendering strings */
PangoAttribute *shortcut_underline; /*< For underlining the shortcut key */
gint ascent; /*!< The font's ascent in pango-units */
g_assert_not_reached(); /* unhandled gradient */
return;
}
-
+
if (a->surface.interlaced) {
gint i;
RrPixel32 *p;
if (b > 0xFF) b = 0xFF;
*up = (r << RrDefaultRedOffset) + (g << RrDefaultGreenOffset)
+ (b << RrDefaultBlueOffset);
-
+
r = (*down >> RrDefaultRedOffset) & 0xFF;
r -= (r * s->bevel_dark_adjust) >> 8;
g = (*down >> RrDefaultGreenOffset) & 0xFF;
}
}
-static void gradient_solid(RrAppearance *l, gint w, gint h)
+static void gradient_solid(RrAppearance *l, gint w, gint h)
{
gint i;
RrPixel32 pix;
left, bottom, right, bottom);
XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
right, bottom, right, top);
-
+
XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
left, top, right, top);
XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
left, bottom, right, bottom);
XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
right, bottom, right, top);
-
+
XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
left, top, right, top);
XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
left, top, right, bottom);
}
break;
- default:
+ default:
g_assert_not_reached(); /* unhandled ReliefType */
}
}
current = COLOR(y2);
for (x = w - 1; x >= 0; --x)
*(data++) = current;
-
+
NEXT(y2);
}
-
+
for (y3 = y3sz; y3 > 0; --y3) {
current = COLOR(y3);
for (x = w - 1; x >= 0; --x)
for (x = w - 1; x > 0; --x) { /* 0 -> w-1 */
*(data++) = COLOR(x);
-
+
NEXT(x);
}
*data = COLOR(x);
for (x = w - 1; x > 0; --x) { /* 0 -> w-1 */
*(data++) = COLOR(x);
-
+
NEXT(x);
}
*data = COLOR(x);
*(data+inw-x) = current;
*(end-x) = current;
*(end-(inw-x)) = current;
-
+
NEXT(x);
}
current = COLOR(x);
gulong dstX, dstY, srcX, srcY;
gulong srcX1, srcX2, srcY1, srcY2;
gulong ratioX, ratioY;
-
+
ratioX = (srcW << FRACTION) / dstW;
ratioY = (srcH << FRACTION) / dstH;
-
+
srcY2 = 0;
for (dstY = 0; dstY < dstH; dstY++) {
srcY1 = srcY2;
srcY2 += ratioY;
-
+
srcX2 = 0;
for (dstX = 0; dstX < dstW; dstX++) {
gulong red = 0, green = 0, blue = 0, alpha = 0;
gulong portionX, portionY, portionXY, sumXY = 0;
RrPixel32 pixel;
-
+
srcX1 = srcX2;
srcX2 += ratioX;
-
+
for (srcY = srcY1; srcY < srcY2; srcY += (1UL << FRACTION)) {
if (srcY == srcY1) {
srcY = FLOOR(srcY);
portionY = srcY2 - srcY;
else
portionY = (1UL << FRACTION);
-
+
for (srcX = srcX1; srcX < srcX2; srcX += (1UL << FRACTION)) {
if (srcX == srcX1) {
srcX = FLOOR(srcX);
portionX = srcX2 - srcX;
else
portionX = (1UL << FRACTION);
-
+
portionXY = (portionX * portionY) >> FRACTION;
sumXY += portionXY;
-
+
pixel = *(src + (srcY >> FRACTION) * srcW
+ (srcX >> FRACTION));
red += ((pixel >> RrDefaultRedOffset) & 0xFF)
* portionXY;
}
}
-
+
g_assert(sumXY != 0);
red /= sumXY;
green /= sumXY;
blue /= sumXY;
alpha /= sumXY;
-
+
*dst++ = (red << RrDefaultRedOffset) |
(green << RrDefaultGreenOffset) |
(blue << RrDefaultBlueOffset) |
{
gint l, t, r, b;
RrMargins(a, &l, &t, &r, &b);
- RECT_SET(tarea, l, t, w - l - r, h - t - b);
- }
+ RECT_SET(tarea, l, t, w - l - r, h - t - b);
+ }
for (i = 0; i < a->textures; i++) {
switch (a->texture[i].type) {
pixel_data_to_pixmap(a, 0, 0, w, h);
}
if (a->xftdraw == NULL) {
- a->xftdraw = XftDrawCreate(RrDisplay(a->inst), a->pixmap,
+ a->xftdraw = XftDrawCreate(RrDisplay(a->inst), a->pixmap,
RrVisual(a->inst),
RrColormap(a->inst));
}
if (spo->primary != NULL)
spc->primary = RrColorNew(copy->inst,
spo->primary->r,
- spo->primary->g,
+ spo->primary->g,
spo->primary->b);
else spc->primary = NULL;
break;
case RR_TEXTURE_TEXT:
m = RrFontMeasureString(a->texture[i].data.text.font,
- a->texture[i].data.text.string,
+ a->texture[i].data.text.string,
a->texture[i].data.text.shadow_offset_x,
a->texture[i].data.text.shadow_offset_y);
w = MAX(w, m->width);
RrColor *primary;
RrColor *secondary;
RrColor *border_color;
- RrColor *bevel_dark;
+ RrColor *bevel_dark;
RrColor *bevel_light;
RrColor *interlace_color;
gboolean interlaced;
ob_root = RootWindow(ob_display, ob_screen);
win =
XCreateWindow(ob_display, RootWindow(ob_display, 0),
- 10, 10, w, h, 10,
+ 10, 10, w, h, 10,
CopyFromParent, /* depth */
CopyFromParent, /* class */
CopyFromParent, /* visual */
"menu.items.active.text.color",
&theme->menu_selected_color))
theme->menu_selected_color = RrColorNew(inst, 0, 0, 0);
-
+
/* load the image masks */
/* maximize button masks */
theme->a_hover_focused_desk =
RrAppearanceCopy(theme->a_hover_focused_max);
theme->a_hover_unfocused_desk =
- RrAppearanceCopy(theme->a_hover_unfocused_max);
+ RrAppearanceCopy(theme->a_hover_unfocused_max);
theme->a_toggled_hover_focused_desk =
RrAppearanceCopy(theme->a_toggled_hover_focused_max);
theme->a_toggled_hover_unfocused_desk =
theme->a_menu_text_normal->texture[0].type =
theme->a_menu_text_selected->texture[0].type =
- theme->a_menu_text_disabled->texture[0].type =
- theme->a_menu_text_disabled_selected->texture[0].type =
+ theme->a_menu_text_disabled->texture[0].type =
+ theme->a_menu_text_disabled_selected->texture[0].type =
RR_TEXTURE_TEXT;
- theme->a_menu_text_normal->texture[0].data.text.justify =
+ theme->a_menu_text_normal->texture[0].data.text.justify =
theme->a_menu_text_selected->texture[0].data.text.justify =
- theme->a_menu_text_disabled->texture[0].data.text.justify =
- theme->a_menu_text_disabled_selected->texture[0].data.text.justify =
+ theme->a_menu_text_disabled->texture[0].data.text.justify =
+ theme->a_menu_text_disabled_selected->texture[0].data.text.justify =
RR_JUSTIFY_LEFT;
theme->a_menu_text_normal->texture[0].data.text.font =
theme->a_menu_text_selected->texture[0].data.text.font =
i = parse_inline_number(p + strlen("shadowtint="));
j = (i > 0 ? 0 : 255);
i = ABS(i*255/100);
-
+
theme->menu_text_normal_shadow_color = RrColorNew(inst, j, j, j);
theme->menu_text_selected_shadow_color = RrColorNew(inst, j, j, j);
theme->menu_text_disabled_shadow_color = RrColorNew(inst, j, j, j);
theme->a_menu_text_disabled_selected->texture[0].data.text.shadow_alpha =
theme->menu_text_disabled_shadow_alpha;
- theme->a_disabled_focused_max->texture[0].type =
- theme->a_disabled_unfocused_max->texture[0].type =
- theme->a_hover_focused_max->texture[0].type =
- theme->a_hover_unfocused_max->texture[0].type =
- theme->a_toggled_hover_focused_max->texture[0].type =
- theme->a_toggled_hover_unfocused_max->texture[0].type =
- theme->a_toggled_focused_unpressed_max->texture[0].type =
- theme->a_toggled_unfocused_unpressed_max->texture[0].type =
- theme->a_toggled_focused_pressed_max->texture[0].type =
- theme->a_toggled_unfocused_pressed_max->texture[0].type =
- theme->a_focused_unpressed_max->texture[0].type =
- theme->a_focused_pressed_max->texture[0].type =
- theme->a_unfocused_unpressed_max->texture[0].type =
- theme->a_unfocused_pressed_max->texture[0].type =
- theme->a_disabled_focused_close->texture[0].type =
- theme->a_disabled_unfocused_close->texture[0].type =
- theme->a_hover_focused_close->texture[0].type =
- theme->a_hover_unfocused_close->texture[0].type =
- theme->a_focused_unpressed_close->texture[0].type =
- theme->a_focused_pressed_close->texture[0].type =
- theme->a_unfocused_unpressed_close->texture[0].type =
- theme->a_unfocused_pressed_close->texture[0].type =
- theme->a_disabled_focused_desk->texture[0].type =
- theme->a_disabled_unfocused_desk->texture[0].type =
- theme->a_hover_focused_desk->texture[0].type =
- theme->a_hover_unfocused_desk->texture[0].type =
- theme->a_toggled_hover_focused_desk->texture[0].type =
- theme->a_toggled_hover_unfocused_desk->texture[0].type =
- theme->a_toggled_focused_unpressed_desk->texture[0].type =
- theme->a_toggled_unfocused_unpressed_desk->texture[0].type =
- theme->a_toggled_focused_pressed_desk->texture[0].type =
- theme->a_toggled_unfocused_pressed_desk->texture[0].type =
- theme->a_focused_unpressed_desk->texture[0].type =
- theme->a_focused_pressed_desk->texture[0].type =
- theme->a_unfocused_unpressed_desk->texture[0].type =
- theme->a_unfocused_pressed_desk->texture[0].type =
- theme->a_disabled_focused_shade->texture[0].type =
- theme->a_disabled_unfocused_shade->texture[0].type =
- theme->a_hover_focused_shade->texture[0].type =
- theme->a_hover_unfocused_shade->texture[0].type =
- theme->a_toggled_hover_focused_shade->texture[0].type =
- theme->a_toggled_hover_unfocused_shade->texture[0].type =
- theme->a_toggled_focused_unpressed_shade->texture[0].type =
- theme->a_toggled_unfocused_unpressed_shade->texture[0].type =
- theme->a_toggled_focused_pressed_shade->texture[0].type =
- theme->a_toggled_unfocused_pressed_shade->texture[0].type =
- theme->a_focused_unpressed_shade->texture[0].type =
- theme->a_focused_pressed_shade->texture[0].type =
- theme->a_unfocused_unpressed_shade->texture[0].type =
- theme->a_unfocused_pressed_shade->texture[0].type =
- theme->a_disabled_focused_iconify->texture[0].type =
- theme->a_disabled_unfocused_iconify->texture[0].type =
- theme->a_hover_focused_iconify->texture[0].type =
- theme->a_hover_unfocused_iconify->texture[0].type =
- theme->a_focused_unpressed_iconify->texture[0].type =
- theme->a_focused_pressed_iconify->texture[0].type =
- theme->a_unfocused_unpressed_iconify->texture[0].type =
+ theme->a_disabled_focused_max->texture[0].type =
+ theme->a_disabled_unfocused_max->texture[0].type =
+ theme->a_hover_focused_max->texture[0].type =
+ theme->a_hover_unfocused_max->texture[0].type =
+ theme->a_toggled_hover_focused_max->texture[0].type =
+ theme->a_toggled_hover_unfocused_max->texture[0].type =
+ theme->a_toggled_focused_unpressed_max->texture[0].type =
+ theme->a_toggled_unfocused_unpressed_max->texture[0].type =
+ theme->a_toggled_focused_pressed_max->texture[0].type =
+ theme->a_toggled_unfocused_pressed_max->texture[0].type =
+ theme->a_focused_unpressed_max->texture[0].type =
+ theme->a_focused_pressed_max->texture[0].type =
+ theme->a_unfocused_unpressed_max->texture[0].type =
+ theme->a_unfocused_pressed_max->texture[0].type =
+ theme->a_disabled_focused_close->texture[0].type =
+ theme->a_disabled_unfocused_close->texture[0].type =
+ theme->a_hover_focused_close->texture[0].type =
+ theme->a_hover_unfocused_close->texture[0].type =
+ theme->a_focused_unpressed_close->texture[0].type =
+ theme->a_focused_pressed_close->texture[0].type =
+ theme->a_unfocused_unpressed_close->texture[0].type =
+ theme->a_unfocused_pressed_close->texture[0].type =
+ theme->a_disabled_focused_desk->texture[0].type =
+ theme->a_disabled_unfocused_desk->texture[0].type =
+ theme->a_hover_focused_desk->texture[0].type =
+ theme->a_hover_unfocused_desk->texture[0].type =
+ theme->a_toggled_hover_focused_desk->texture[0].type =
+ theme->a_toggled_hover_unfocused_desk->texture[0].type =
+ theme->a_toggled_focused_unpressed_desk->texture[0].type =
+ theme->a_toggled_unfocused_unpressed_desk->texture[0].type =
+ theme->a_toggled_focused_pressed_desk->texture[0].type =
+ theme->a_toggled_unfocused_pressed_desk->texture[0].type =
+ theme->a_focused_unpressed_desk->texture[0].type =
+ theme->a_focused_pressed_desk->texture[0].type =
+ theme->a_unfocused_unpressed_desk->texture[0].type =
+ theme->a_unfocused_pressed_desk->texture[0].type =
+ theme->a_disabled_focused_shade->texture[0].type =
+ theme->a_disabled_unfocused_shade->texture[0].type =
+ theme->a_hover_focused_shade->texture[0].type =
+ theme->a_hover_unfocused_shade->texture[0].type =
+ theme->a_toggled_hover_focused_shade->texture[0].type =
+ theme->a_toggled_hover_unfocused_shade->texture[0].type =
+ theme->a_toggled_focused_unpressed_shade->texture[0].type =
+ theme->a_toggled_unfocused_unpressed_shade->texture[0].type =
+ theme->a_toggled_focused_pressed_shade->texture[0].type =
+ theme->a_toggled_unfocused_pressed_shade->texture[0].type =
+ theme->a_focused_unpressed_shade->texture[0].type =
+ theme->a_focused_pressed_shade->texture[0].type =
+ theme->a_unfocused_unpressed_shade->texture[0].type =
+ theme->a_unfocused_pressed_shade->texture[0].type =
+ theme->a_disabled_focused_iconify->texture[0].type =
+ theme->a_disabled_unfocused_iconify->texture[0].type =
+ theme->a_hover_focused_iconify->texture[0].type =
+ theme->a_hover_unfocused_iconify->texture[0].type =
+ theme->a_focused_unpressed_iconify->texture[0].type =
+ theme->a_focused_pressed_iconify->texture[0].type =
+ theme->a_unfocused_unpressed_iconify->texture[0].type =
theme->a_unfocused_pressed_iconify->texture[0].type =
theme->a_menu_bullet_normal->texture[0].type =
theme->a_menu_bullet_selected->texture[0].type = RR_TEXTURE_MASK;
-
- theme->a_disabled_focused_max->texture[0].data.mask.mask =
- theme->a_disabled_unfocused_max->texture[0].data.mask.mask =
+
+ theme->a_disabled_focused_max->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_max->texture[0].data.mask.mask =
theme->max_disabled_mask;
- theme->a_hover_focused_max->texture[0].data.mask.mask =
- theme->a_hover_unfocused_max->texture[0].data.mask.mask =
+ theme->a_hover_focused_max->texture[0].data.mask.mask =
+ theme->a_hover_unfocused_max->texture[0].data.mask.mask =
theme->max_hover_mask;
- theme->a_focused_pressed_max->texture[0].data.mask.mask =
+ theme->a_focused_pressed_max->texture[0].data.mask.mask =
theme->a_unfocused_pressed_max->texture[0].data.mask.mask =
theme->max_pressed_mask;
- theme->a_focused_unpressed_max->texture[0].data.mask.mask =
- theme->a_unfocused_unpressed_max->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_max->texture[0].data.mask.mask =
+ theme->a_unfocused_unpressed_max->texture[0].data.mask.mask =
theme->max_mask;
- theme->a_toggled_hover_focused_max->texture[0].data.mask.mask =
+ theme->a_toggled_hover_focused_max->texture[0].data.mask.mask =
theme->a_toggled_hover_unfocused_max->texture[0].data.mask.mask =
theme->max_toggled_hover_mask;
- theme->a_toggled_focused_unpressed_max->texture[0].data.mask.mask =
+ theme->a_toggled_focused_unpressed_max->texture[0].data.mask.mask =
theme->a_toggled_unfocused_unpressed_max->texture[0].data.mask.mask =
theme->max_toggled_mask;
- theme->a_toggled_focused_pressed_max->texture[0].data.mask.mask =
+ theme->a_toggled_focused_pressed_max->texture[0].data.mask.mask =
theme->a_toggled_unfocused_pressed_max->texture[0].data.mask.mask =
theme->max_toggled_pressed_mask;
- theme->a_disabled_focused_close->texture[0].data.mask.mask =
- theme->a_disabled_unfocused_close->texture[0].data.mask.mask =
+ theme->a_disabled_focused_close->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_close->texture[0].data.mask.mask =
theme->close_disabled_mask;
- theme->a_hover_focused_close->texture[0].data.mask.mask =
- theme->a_hover_unfocused_close->texture[0].data.mask.mask =
+ theme->a_hover_focused_close->texture[0].data.mask.mask =
+ theme->a_hover_unfocused_close->texture[0].data.mask.mask =
theme->close_hover_mask;
- theme->a_focused_pressed_close->texture[0].data.mask.mask =
+ theme->a_focused_pressed_close->texture[0].data.mask.mask =
theme->a_unfocused_pressed_close->texture[0].data.mask.mask =
theme->close_pressed_mask;
- theme->a_focused_unpressed_close->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_close->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_close->texture[0].data.mask.mask =
theme->close_mask;
- theme->a_disabled_focused_desk->texture[0].data.mask.mask =
- theme->a_disabled_unfocused_desk->texture[0].data.mask.mask =
+ theme->a_disabled_focused_desk->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_desk->texture[0].data.mask.mask =
theme->desk_disabled_mask;
- theme->a_hover_focused_desk->texture[0].data.mask.mask =
- theme->a_hover_unfocused_desk->texture[0].data.mask.mask =
+ theme->a_hover_focused_desk->texture[0].data.mask.mask =
+ theme->a_hover_unfocused_desk->texture[0].data.mask.mask =
theme->desk_hover_mask;
- theme->a_focused_pressed_desk->texture[0].data.mask.mask =
+ theme->a_focused_pressed_desk->texture[0].data.mask.mask =
theme->a_unfocused_pressed_desk->texture[0].data.mask.mask =
theme->desk_pressed_mask;
- theme->a_focused_unpressed_desk->texture[0].data.mask.mask =
- theme->a_unfocused_unpressed_desk->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_desk->texture[0].data.mask.mask =
+ theme->a_unfocused_unpressed_desk->texture[0].data.mask.mask =
theme->desk_mask;
- theme->a_toggled_hover_focused_desk->texture[0].data.mask.mask =
+ theme->a_toggled_hover_focused_desk->texture[0].data.mask.mask =
theme->a_toggled_hover_unfocused_desk->texture[0].data.mask.mask =
theme->desk_toggled_hover_mask;
- theme->a_toggled_focused_unpressed_desk->texture[0].data.mask.mask =
+ theme->a_toggled_focused_unpressed_desk->texture[0].data.mask.mask =
theme->a_toggled_unfocused_unpressed_desk->texture[0].data.mask.mask =
theme->desk_toggled_mask;
- theme->a_toggled_focused_pressed_desk->texture[0].data.mask.mask =
+ theme->a_toggled_focused_pressed_desk->texture[0].data.mask.mask =
theme->a_toggled_unfocused_pressed_desk->texture[0].data.mask.mask =
theme->desk_toggled_pressed_mask;
- theme->a_disabled_focused_shade->texture[0].data.mask.mask =
- theme->a_disabled_unfocused_shade->texture[0].data.mask.mask =
+ theme->a_disabled_focused_shade->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_shade->texture[0].data.mask.mask =
theme->shade_disabled_mask;
- theme->a_hover_focused_shade->texture[0].data.mask.mask =
- theme->a_hover_unfocused_shade->texture[0].data.mask.mask =
+ theme->a_hover_focused_shade->texture[0].data.mask.mask =
+ theme->a_hover_unfocused_shade->texture[0].data.mask.mask =
theme->shade_hover_mask;
- theme->a_focused_pressed_shade->texture[0].data.mask.mask =
+ theme->a_focused_pressed_shade->texture[0].data.mask.mask =
theme->a_unfocused_pressed_shade->texture[0].data.mask.mask =
theme->shade_pressed_mask;
- theme->a_focused_unpressed_shade->texture[0].data.mask.mask =
- theme->a_unfocused_unpressed_shade->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_shade->texture[0].data.mask.mask =
+ theme->a_unfocused_unpressed_shade->texture[0].data.mask.mask =
theme->shade_mask;
- theme->a_toggled_hover_focused_shade->texture[0].data.mask.mask =
+ theme->a_toggled_hover_focused_shade->texture[0].data.mask.mask =
theme->a_toggled_hover_unfocused_shade->texture[0].data.mask.mask =
theme->shade_toggled_hover_mask;
- theme->a_toggled_focused_unpressed_shade->texture[0].data.mask.mask =
+ theme->a_toggled_focused_unpressed_shade->texture[0].data.mask.mask =
theme->a_toggled_unfocused_unpressed_shade->texture[0].data.mask.mask =
theme->shade_toggled_mask;
- theme->a_toggled_focused_pressed_shade->texture[0].data.mask.mask =
+ theme->a_toggled_focused_pressed_shade->texture[0].data.mask.mask =
theme->a_toggled_unfocused_pressed_shade->texture[0].data.mask.mask =
theme->shade_toggled_pressed_mask;
- theme->a_disabled_focused_iconify->texture[0].data.mask.mask =
- theme->a_disabled_unfocused_iconify->texture[0].data.mask.mask =
+ theme->a_disabled_focused_iconify->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_iconify->texture[0].data.mask.mask =
theme->iconify_disabled_mask;
- theme->a_hover_focused_iconify->texture[0].data.mask.mask =
- theme->a_hover_unfocused_iconify->texture[0].data.mask.mask =
+ theme->a_hover_focused_iconify->texture[0].data.mask.mask =
+ theme->a_hover_unfocused_iconify->texture[0].data.mask.mask =
theme->iconify_hover_mask;
- theme->a_focused_pressed_iconify->texture[0].data.mask.mask =
+ theme->a_focused_pressed_iconify->texture[0].data.mask.mask =
theme->a_unfocused_pressed_iconify->texture[0].data.mask.mask =
theme->iconify_pressed_mask;
- theme->a_focused_unpressed_iconify->texture[0].data.mask.mask =
- theme->a_unfocused_unpressed_iconify->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_iconify->texture[0].data.mask.mask =
+ theme->a_unfocused_unpressed_iconify->texture[0].data.mask.mask =
theme->iconify_mask;
- theme->a_menu_bullet_normal->texture[0].data.mask.mask =
- theme->a_menu_bullet_selected->texture[0].data.mask.mask =
+ theme->a_menu_bullet_normal->texture[0].data.mask.mask =
+ theme->a_menu_bullet_selected->texture[0].data.mask.mask =
theme->menu_bullet_mask;
- theme->a_disabled_focused_max->texture[0].data.mask.color =
- theme->a_disabled_focused_close->texture[0].data.mask.color =
- theme->a_disabled_focused_desk->texture[0].data.mask.color =
- theme->a_disabled_focused_shade->texture[0].data.mask.color =
- theme->a_disabled_focused_iconify->texture[0].data.mask.color =
+ theme->a_disabled_focused_max->texture[0].data.mask.color =
+ theme->a_disabled_focused_close->texture[0].data.mask.color =
+ theme->a_disabled_focused_desk->texture[0].data.mask.color =
+ theme->a_disabled_focused_shade->texture[0].data.mask.color =
+ theme->a_disabled_focused_iconify->texture[0].data.mask.color =
theme->titlebut_disabled_focused_color;
- theme->a_disabled_unfocused_max->texture[0].data.mask.color =
- theme->a_disabled_unfocused_close->texture[0].data.mask.color =
- theme->a_disabled_unfocused_desk->texture[0].data.mask.color =
- theme->a_disabled_unfocused_shade->texture[0].data.mask.color =
- theme->a_disabled_unfocused_iconify->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_max->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_close->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_desk->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_shade->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_iconify->texture[0].data.mask.color =
theme->titlebut_disabled_unfocused_color;
- theme->a_hover_focused_max->texture[0].data.mask.color =
- theme->a_hover_focused_close->texture[0].data.mask.color =
- theme->a_hover_focused_desk->texture[0].data.mask.color =
- theme->a_hover_focused_shade->texture[0].data.mask.color =
- theme->a_hover_focused_iconify->texture[0].data.mask.color =
+ theme->a_hover_focused_max->texture[0].data.mask.color =
+ theme->a_hover_focused_close->texture[0].data.mask.color =
+ theme->a_hover_focused_desk->texture[0].data.mask.color =
+ theme->a_hover_focused_shade->texture[0].data.mask.color =
+ theme->a_hover_focused_iconify->texture[0].data.mask.color =
theme->titlebut_hover_focused_color;
- theme->a_hover_unfocused_max->texture[0].data.mask.color =
- theme->a_hover_unfocused_close->texture[0].data.mask.color =
- theme->a_hover_unfocused_desk->texture[0].data.mask.color =
- theme->a_hover_unfocused_shade->texture[0].data.mask.color =
- theme->a_hover_unfocused_iconify->texture[0].data.mask.color =
+ theme->a_hover_unfocused_max->texture[0].data.mask.color =
+ theme->a_hover_unfocused_close->texture[0].data.mask.color =
+ theme->a_hover_unfocused_desk->texture[0].data.mask.color =
+ theme->a_hover_unfocused_shade->texture[0].data.mask.color =
+ theme->a_hover_unfocused_iconify->texture[0].data.mask.color =
theme->titlebut_hover_unfocused_color;
theme->a_toggled_hover_focused_max->texture[0].data.mask.color =
theme->a_toggled_hover_focused_desk->texture[0].data.mask.color =
theme->a_toggled_unfocused_pressed_desk->texture[0].data.mask.color =
theme->a_toggled_unfocused_pressed_shade->texture[0].data.mask.color =
theme->titlebut_toggled_unfocused_pressed_color;
- theme->a_focused_unpressed_max->texture[0].data.mask.color =
- theme->a_focused_unpressed_close->texture[0].data.mask.color =
- theme->a_focused_unpressed_desk->texture[0].data.mask.color =
- theme->a_focused_unpressed_shade->texture[0].data.mask.color =
- theme->a_focused_unpressed_iconify->texture[0].data.mask.color =
+ theme->a_focused_unpressed_max->texture[0].data.mask.color =
+ theme->a_focused_unpressed_close->texture[0].data.mask.color =
+ theme->a_focused_unpressed_desk->texture[0].data.mask.color =
+ theme->a_focused_unpressed_shade->texture[0].data.mask.color =
+ theme->a_focused_unpressed_iconify->texture[0].data.mask.color =
theme->titlebut_focused_unpressed_color;
- theme->a_focused_pressed_max->texture[0].data.mask.color =
- theme->a_focused_pressed_close->texture[0].data.mask.color =
- theme->a_focused_pressed_desk->texture[0].data.mask.color =
- theme->a_focused_pressed_shade->texture[0].data.mask.color =
+ theme->a_focused_pressed_max->texture[0].data.mask.color =
+ theme->a_focused_pressed_close->texture[0].data.mask.color =
+ theme->a_focused_pressed_desk->texture[0].data.mask.color =
+ theme->a_focused_pressed_shade->texture[0].data.mask.color =
theme->a_focused_pressed_iconify->texture[0].data.mask.color =
theme->titlebut_focused_pressed_color;
- theme->a_unfocused_unpressed_max->texture[0].data.mask.color =
- theme->a_unfocused_unpressed_close->texture[0].data.mask.color =
- theme->a_unfocused_unpressed_desk->texture[0].data.mask.color =
- theme->a_unfocused_unpressed_shade->texture[0].data.mask.color =
- theme->a_unfocused_unpressed_iconify->texture[0].data.mask.color =
+ theme->a_unfocused_unpressed_max->texture[0].data.mask.color =
+ theme->a_unfocused_unpressed_close->texture[0].data.mask.color =
+ theme->a_unfocused_unpressed_desk->texture[0].data.mask.color =
+ theme->a_unfocused_unpressed_shade->texture[0].data.mask.color =
+ theme->a_unfocused_unpressed_iconify->texture[0].data.mask.color =
theme->titlebut_unfocused_unpressed_color;
- theme->a_unfocused_pressed_max->texture[0].data.mask.color =
- theme->a_unfocused_pressed_close->texture[0].data.mask.color =
- theme->a_unfocused_pressed_desk->texture[0].data.mask.color =
- theme->a_unfocused_pressed_shade->texture[0].data.mask.color =
+ theme->a_unfocused_pressed_max->texture[0].data.mask.color =
+ theme->a_unfocused_pressed_close->texture[0].data.mask.color =
+ theme->a_unfocused_pressed_desk->texture[0].data.mask.color =
+ theme->a_unfocused_pressed_shade->texture[0].data.mask.color =
theme->a_unfocused_pressed_iconify->texture[0].data.mask.color =
theme->titlebut_unfocused_pressed_color;
- theme->a_menu_bullet_normal->texture[0].data.mask.color =
+ theme->a_menu_bullet_normal->texture[0].data.mask.color =
theme->menu_color;
- theme->a_menu_bullet_selected->texture[0].data.mask.color =
+ theme->a_menu_bullet_selected->texture[0].data.mask.color =
theme->menu_selected_color;
g_free(path);
RrPixmapMaskFree(theme->close_pressed_mask);
RrPixmapMaskFree(theme->menu_bullet_mask);
- RrFontClose(theme->win_font_focused);
+ RrFontClose(theme->win_font_focused);
RrFontClose(theme->win_font_unfocused);
RrFontClose(theme->menu_title_font);
RrFontClose(theme->menu_font);
gchar *rclass = create_class_name(rname);
gchar *rettype, *end;
XrmValue retvalue;
-
+
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
*value = (gint)strtol(retvalue.addr, &end, 10);
gchar *rclass = create_class_name(rname);
gchar *rettype;
XrmValue retvalue;
-
+
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
*value = retvalue.addr;
gchar *rclass = create_class_name(rname);
gchar *rettype;
XrmValue retvalue;
-
+
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
RrColor *c = RrColorParse(inst, retvalue.addr);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, xswamask, &xswa);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
size.flags = PAspect;
size.min_aspect.x = 3;
size.max_aspect.x = 3;
size.max_aspect.y = 3;
XSetWMNormalHints(display, win, &size);
-
+
XMapWindow(display, win);
XFlush(display);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XSelectInput(display, win, ExposureMask | StructureNotifyMask);
XMapWindow(display, win);
x, y, w, h, 0, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XSelectInput(display, win, (ExposureMask | StructureNotifyMask |
GravityNotify));
x, y, w, h, 0, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XChangeProperty(display, win, _net_state, XA_ATOM, 32,
PropModeReplace, (unsigned char*)&_net_max, 2);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win1,WhitePixel(display,0));
- XSetWindowBackground(display,win2,BlackPixel(display,0));
+ XSetWindowBackground(display,win1,WhitePixel(display,0));
+ XSetWindowBackground(display,win2,BlackPixel(display,0));
XChangeProperty(display, win1, sm_id, enc, 8,
PropModeAppend, "abcdefg", strlen("abcdefg"));
win = XCreateWindow(display, RootWindow(display, 0),
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
XSendEvent(display, RootWindow(display, DefaultScreen(display)), False,
SubstructureRedirectMask|SubstructureNotifyMask, &msg);
usleep(10000);
-
+
XUnmapWindow(display, win);
XSync(display, False);
0,0,150,150, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,one,WhitePixel(display,0));
- XSetWindowBackground(display,two,BlackPixel(display,0));
+ XSetWindowBackground(display,one,WhitePixel(display,0));
+ XSetWindowBackground(display,two,BlackPixel(display,0));
XSetTransientForHint(display, two, one);
10, 10, w-20, h-20, 0, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
- XSetWindowBackground(display,child,BlackPixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,child,BlackPixel(display,0));
XSelectInput(display, win,
FocusChangeMask|EnterWindowMask|LeaveWindowMask);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
XSetWMNormalHints(display, win, hints);
XFree(hints);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
0,0,100,100, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,one,WhitePixel(display,0));
- XSetWindowBackground(display,two,BlackPixel(display,0));
+ XSetWindowBackground(display,one,WhitePixel(display,0));
+ XSetWindowBackground(display,two,BlackPixel(display,0));
XSetTransientForHint(display, two, RootWindow(display,0));
XChangeProperty(display, two, state, XA_ATOM, 32,
XSetWMHints(display, two, wmhints);
XFree(wmhints);
-
+
XMapWindow(display, one);
XFlush(display);
sleep(1);
0,0,100,100, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,one,WhitePixel(display,0));
- XSetWindowBackground(display,two,BlackPixel(display,0));
+ XSetWindowBackground(display,one,WhitePixel(display,0));
+ XSetWindowBackground(display,two,BlackPixel(display,0));
XSetTransientForHint(display, two, RootWindow(display,0));
XSetWMHints(display, two, wmhints);
XFree(wmhints);
-
+
XMapWindow(display, one);
XMapWindow(display, two);
XFlush(display);
20,20,60,60, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,main,WhitePixel(display,0));
- XSetWindowBackground(display,grouptran,BlackPixel(display,0));
- XSetWindowBackground(display,child,WhitePixel(display,0));
+ XSetWindowBackground(display,main,WhitePixel(display,0));
+ XSetWindowBackground(display,grouptran,BlackPixel(display,0));
+ XSetWindowBackground(display,child,WhitePixel(display,0));
XSetTransientForHint(display, grouptran, RootWindow(display,0));
XSetTransientForHint(display, child, grouptran);
XSetWMHints(display, child, wmhints);
XFree(wmhints);
-
+
XMapWindow(display, main);
XMapWindow(display, grouptran);
XMapWindow(display, child);
0,0,100,100, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,one,WhitePixel(display,0));
- XSetWindowBackground(display,two,BlackPixel(display,0));
+ XSetWindowBackground(display,one,WhitePixel(display,0));
+ XSetWindowBackground(display,two,BlackPixel(display,0));
XSetTransientForHint(display, one, RootWindow(display,0));
XSetTransientForHint(display, two, RootWindow(display,0));
XSetWMHints(display, two, wmhints);
XFree(wmhints);
-
+
XMapWindow(display, one);
XMapWindow(display, two);
XFlush(display);
0,0,100,100, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,one,WhitePixel(display,0));
- XSetWindowBackground(display,two,BlackPixel(display,0));
+ XSetWindowBackground(display,one,WhitePixel(display,0));
+ XSetWindowBackground(display,two,BlackPixel(display,0));
XSetTransientForHint(display, one, RootWindow(display,0));
XSetTransientForHint(display, two, one);
XSetWMHints(display, three, wmhints);
XFree(wmhints);
-
+
XMapWindow(display, one);
XMapWindow(display, two);
XMapWindow(display, three);
XGetWindowProperty(d, win, state, 0, 1,
False, state, &ret_type, &ret_format,
&ret_items, &ret_bytesleft,
- (unsigned char**) &prop_return);
+ (unsigned char**) &prop_return);
if (ret_type == None || ret_items < 1)
return None;
return win; // found it!
Pixmap p;
Cursor cur;
XEvent ev;
-
+
printf("Click on a window with an icon...\n");
-
+
//int id = strtol(argv[1], NULL, 16);
XUngrabPointer(d, CurrentTime);
cur = XCreateFontCursor(d, XC_crosshair);
}
printf("Using window 0x%lx\n", id);
-
+
do {
unsigned int w, h;
-
+
XGetWindowProperty(d, id, net_wm_icon, offset++, 1,
False, XA_CARDINAL, &ret_type, &ret_format,
&ret_items, &ret_bytesleft,
offset += w*h;
printf("Found icon with size %dx%d\n", w, h);
-
+
i[image] = XCreateImage(d, DefaultVisual(d, s), DefaultDepth(d, s),
ZPixmap, 0, NULL, w, h, 32, 0);
assert(i[image]);
unsigned char bgr = 0;
unsigned char bgg = 0;
unsigned char bgb = 0;
-
+
r = bgr + (r - bgr) * alpha / 256;
g = bgg + (g - bgg) * alpha / 256;
b = bgb + (b - bgb) * alpha / 256;
x += i[j]->width;
XDestroyImage(i[j]);
}
-
+
XSetWindowBackgroundPixmap(d, win, p);
XClearWindow(d, win);
XSetWMHints(display, win, hints);
XFree(hints);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
x, y, w/2, h/2, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,parent,WhitePixel(display,0));
- XSetWindowBackground(display,child,BlackPixel(display,0));
+ XSetWindowBackground(display,parent,WhitePixel(display,0));
+ XSetWindowBackground(display,child,BlackPixel(display,0));
XSetTransientForHint(display, child, parent);
XChangeProperty(display, child, state, XA_ATOM, 32,
PropModeReplace, (unsigned char*)&modal, 1);
-
+
XMapWindow(display, parent);
XMapWindow(display, child);
XFlush(display);
x, y, w/2, h/2, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,parent,WhitePixel(display,0));
- XSetWindowBackground(display,child,BlackPixel(display,0));
+ XSetWindowBackground(display,parent,WhitePixel(display,0));
+ XSetWindowBackground(display,child,BlackPixel(display,0));
XSetTransientForHint(display, child, parent);
-
+
XMapWindow(display, parent);
XMapWindow(display, child);
XFlush(display);
ce.xclient.data.l[2] = 0;
XSendEvent(display, RootWindow(display, DefaultScreen(display)),
False, SubstructureNotifyMask | SubstructureRedirectMask, &ce);
-
+
while (1) {
XNextEvent(display, &report);
}
x, y, w/2, h/2, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,parent,WhitePixel(display,0));
- XSetWindowBackground(display,child,BlackPixel(display,0));
+ XSetWindowBackground(display,parent,WhitePixel(display,0));
+ XSetWindowBackground(display,child,BlackPixel(display,0));
XSetTransientForHint(display, child, parent);
-
+
XMapWindow(display, parent);
XMapWindow(display, child);
XFlush(display);
ce.xclient.data.l[0] = 0;
XSendEvent(display, RootWindow(display, DefaultScreen(display)),
False, SubstructureNotifyMask | SubstructureRedirectMask, &ce);
-
+
while (1) {
XNextEvent(display, &report);
}
x, y, w, h, 0, CopyFromParent, CopyFromParent,
CopyFromParent, xswamask, &xswa);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
size.flags = PMinSize | PMaxSize;
size.max_width = 0;
size.max_height = 0;
size.min_height = h;
XSetWMNormalHints(display, win, &size);
-
+
XSelectInput(display, win, ExposureMask | StructureNotifyMask);
XMapWindow(display, win);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, xswamask, &xswa);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
win = XCreateWindow(display, RootWindow(display, 0),
x, y, w, h, 0, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
size = XAllocSizeHints();
size->flags = PPosition;
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
win = XCreateWindow(display, RootWindow(display, 0),
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
ShapeBounding, 0, 0, &xrect, 1,
ShapeSet, Unsorted);
- XSetWindowBackground(display,win,BlackPixel(display,0));
+ XSetWindowBackground(display,win,BlackPixel(display,0));
XMapWindow(display, win);
XFlush(display);
win = XCreateWindow(display, RootWindow(display, 0),
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
usleep(1000);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XChangeProperty(display, win, state, XA_ATOM, 32,
PropModeReplace, (unsigned char*)&skip, 1);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
x, y, w/2, h/2, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,parent,WhitePixel(display,0));
- XSetWindowBackground(display,child1,BlackPixel(display,0));
+ XSetWindowBackground(display,parent,WhitePixel(display,0));
+ XSetWindowBackground(display,child1,BlackPixel(display,0));
XSetWindowBackground(display,child2,WhitePixel(display,0));
hints = XAllocWMHints();
XSetTransientForHint(display, child1,
RootWindow(display, DefaultScreen(display)));
XSetTransientForHint(display, child2, parent);
-
+
XMapWindow(display, parent);
XFlush(display);
sleep(3);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
// XStringListToTextProperty(&argv[1], 1, &name);
// XSetWMName(display, win, &name);
x, y, w, h, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, NULL);
- XSetWindowBackground(display,win,WhitePixel(display,0));
+ XSetWindowBackground(display,win,WhitePixel(display,0));
XMapWindow(display, win);
XFlush(display);
x, y, w/2, h/2, 10, CopyFromParent, CopyFromParent,
CopyFromParent, 0, 0);
- XSetWindowBackground(display,win,WhitePixel(display,0));
-
+ XSetWindowBackground(display,win,WhitePixel(display,0));
+
XMapWindow(display, win);
XFlush(display);