Merge branch 'backport' into work

Conflicts:

	obt/keyboard.c
	openbox/actions/cyclewindows.c
	openbox/actions/directionalwindows.c
	openbox/frame.c
	openbox/openbox.c
This commit is contained in:
Mikael Magnusson 2008-03-08 17:43:32 +01:00
commit ec328fc04f
22 changed files with 34 additions and 70 deletions

View file

@ -58,7 +58,6 @@ struct _ObActionsAct {
static GSList *registered = NULL; static GSList *registered = NULL;
void actions_startup(gboolean reconfig) void actions_startup(gboolean reconfig)
{ {
if (reconfig) return; if (reconfig) return;

View file

@ -75,7 +75,7 @@ static gpointer setup_func(xmlNodePtr node)
m = obt_parse_find_node(n->children, "action"); m = obt_parse_find_node(n->children, "action");
while (m) { while (m) {
ObActionsAct *action = actions_parse(m); ObActionsAct *action = actions_parse(m);
if (action) o->actions = g_slist_prepend(o->actions, action); if (action) o->actions = g_slist_append(o->actions, action);
m = obt_parse_find_node(m->next, "action"); m = obt_parse_find_node(m->next, "action");
} }
} }

View file

@ -118,8 +118,6 @@ static gboolean run_func(ObActionsData *data, gpointer options)
Options *o = options; Options *o = options;
guint d; guint d;
switch (o->type) { switch (o->type) {
case LAST: case LAST:
d = screen_last_desktop; d = screen_last_desktop;

View file

@ -91,7 +91,7 @@ static gpointer setup_func(xmlNodePtr node)
m = obt_parse_find_node(n->children, "action"); m = obt_parse_find_node(n->children, "action");
while (m) { while (m) {
ObActionsAct *action = actions_parse(m); ObActionsAct *action = actions_parse(m);
if (action) o->actions = g_slist_prepend(o->actions, action); if (action) o->actions = g_slist_append(o->actions, action);
m = obt_parse_find_node(m->next, "action"); m = obt_parse_find_node(m->next, "action");
} }
} }

View file

@ -108,7 +108,6 @@ static void client_call_notifies(ObClient *self, GSList *list);
static void client_ping_event(ObClient *self, gboolean dead); static void client_ping_event(ObClient *self, gboolean dead);
static void client_prompt_kill(ObClient *self); static void client_prompt_kill(ObClient *self);
void client_startup(gboolean reconfig) void client_startup(gboolean reconfig)
{ {
if ((client_default_icon = RrImageCacheFind(ob_rr_icons, if ((client_default_icon = RrImageCacheFind(ob_rr_icons,
@ -583,7 +582,6 @@ void client_manage(Window window, ObPrompt *prompt)
hooks_queue(OB_HOOK_WIN_NEW, self); hooks_queue(OB_HOOK_WIN_NEW, self);
} }
ObClient *client_fake_manage(Window window) ObClient *client_fake_manage(Window window)
{ {
ObClient *self; ObClient *self;
@ -1310,7 +1308,6 @@ static void client_update_transient_tree(ObClient *self,
transient windows as their children. transient windows as their children.
* * */ * * */
/* No change has occured */ /* No change has occured */
if (oldgroup == newgroup && if (oldgroup == newgroup &&
oldgtran == newgtran && oldgtran == newgtran &&
@ -2126,7 +2123,6 @@ void client_update_icons(ObClient *self)
(gint*)&w, (gint*)&h, &data); (gint*)&w, (gint*)&h, &data);
obt_display_ignore_errors(FALSE); obt_display_ignore_errors(FALSE);
if (xicon) { if (xicon) {
if (w > 0 && h > 0) { if (w > 0 && h > 0) {
/* is this icon in the cache yet? */ /* is this icon in the cache yet? */
@ -2623,7 +2619,6 @@ gboolean client_enter_focusable(ObClient *self)
self->type != OB_CLIENT_TYPE_DESKTOP); self->type != OB_CLIENT_TYPE_DESKTOP);
} }
static void client_apply_startup_state(ObClient *self, static void client_apply_startup_state(ObClient *self,
gint x, gint y, gint w, gint h) gint x, gint y, gint w, gint h)
{ {
@ -2933,7 +2928,6 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
g_assert(*h > 0); g_assert(*h > 0);
} }
void client_configure(ObClient *self, gint x, gint y, gint w, gint h, void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
gboolean user, gboolean final, gboolean force_reply) gboolean user, gboolean final, gboolean force_reply)
{ {

View file

@ -197,5 +197,4 @@ ObAppSettings* config_create_app_settings(void);
void config_app_settings_copy_non_defaults(const ObAppSettings *src, void config_app_settings_copy_non_defaults(const ObAppSettings *src,
ObAppSettings *dest); ObAppSettings *dest);
#endif #endif

View file

@ -1125,7 +1125,6 @@ static void event_handle_client(ObClient *client, XEvent *e)
move = TRUE; move = TRUE;
} }
if (e->xconfigurerequest.value_mask & CWStackMode) { if (e->xconfigurerequest.value_mask & CWStackMode) {
ObClient *sibling = NULL; ObClient *sibling = NULL;
gulong ignore_start; gulong ignore_start;

View file

@ -364,4 +364,3 @@ gboolean focus_valid_target(ObClient *ft,
return ok; return ok;
} }

View file

@ -95,7 +95,6 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
list = client_list; list = client_list;
} }
if (focus_cycle_target == NULL) { if (focus_cycle_target == NULL) {
focus_cycle_iconic_windows = TRUE; focus_cycle_iconic_windows = TRUE;
focus_cycle_all_desktops = all_desktops; focus_cycle_all_desktops = all_desktops;

View file

@ -1133,15 +1133,37 @@ static gboolean is_button_present(ObFrame *self, const gchar *lc, gint dir) {
return FALSE; return FALSE;
} }
static void place_button(ObFrame *self, const char *lc, gint bwidth,
gint left, gint i,
gint *x, gint *button_on, gint *button_x)
{
if (!(*button_on = is_button_present(self, lc, i)))
return;
self->label_width -= bwidth;
if (i > 0)
*button_x = *x;
*x += i * bwidth;
if (i < 0) {
if (self->label_x <= left || *x > self->label_x) {
*button_x = *x;
} else {
/* the button would have been drawn on top of another button */
*button_on = FALSE;
self->label_width += bwidth;
}
}
}
static void layout_title(ObFrame *self) static void layout_title(ObFrame *self)
{ {
gchar *lc; gchar *lc;
gint i; gint i;
const gint bwidth = ob_rr_theme->button_size + ob_rr_theme->paddingx + 1; const gint bwidth = ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;
/* position of the left most button */ /* position of the leftmost button */
const gint left = ob_rr_theme->paddingx + 1; const gint left = ob_rr_theme->paddingx + 1;
/* position of the right most button */ /* position of the rightmost button */
const gint right = self->width; const gint right = self->width;
/* turn them all off */ /* turn them all off */
@ -1180,53 +1202,23 @@ static void layout_title(ObFrame *self)
break; /* break the for loop, do other side of label */ break; /* break the for loop, do other side of label */
} else if (*lc == 'N') { } else if (*lc == 'N') {
if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICON; if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICON;
if ((self->icon_on = is_button_present(self, lc, i))) { /* icon is bigger than buttons */
/* icon is bigger than buttons */ place_button(self, lc, bwidth + 2, left, i, &x, &self->icon_on, &self->icon_x);
self->label_width -= bwidth + 2;
if (i > 0) self->icon_x = x;
x += i * (bwidth + 2);
if (i < 0) self->icon_x = x;
}
} else if (*lc == 'D') { } else if (*lc == 'D') {
if (firstcon) *firstcon = OB_FRAME_CONTEXT_ALLDESKTOPS; if (firstcon) *firstcon = OB_FRAME_CONTEXT_ALLDESKTOPS;
if ((self->desk_on = is_button_present(self, lc, i))) { place_button(self, lc, bwidth, left, i, &x, &self->desk_on, &self->desk_x);
self->label_width -= bwidth;
if (i > 0) self->desk_x = x;
x += i * bwidth;
if (i < 0) self->desk_x = x;
}
} else if (*lc == 'S') { } else if (*lc == 'S') {
if (firstcon) *firstcon = OB_FRAME_CONTEXT_SHADE; if (firstcon) *firstcon = OB_FRAME_CONTEXT_SHADE;
if ((self->shade_on = is_button_present(self, lc, i))) { place_button(self, lc, bwidth, left, i, &x, &self->shade_on, &self->shade_x);
self->label_width -= bwidth;
if (i > 0) self->shade_x = x;
x += i * bwidth;
if (i < 0) self->shade_x = x;
}
} else if (*lc == 'I') { } else if (*lc == 'I') {
if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICONIFY; if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICONIFY;
if ((self->iconify_on = is_button_present(self, lc, i))) { place_button(self, lc, bwidth, left, i, &x, &self->iconify_on, &self->iconify_x);
self->label_width -= bwidth;
if (i > 0) self->iconify_x = x;
x += i * bwidth;
if (i < 0) self->iconify_x = x;
}
} else if (*lc == 'M') { } else if (*lc == 'M') {
if (firstcon) *firstcon = OB_FRAME_CONTEXT_MAXIMIZE; if (firstcon) *firstcon = OB_FRAME_CONTEXT_MAXIMIZE;
if ((self->max_on = is_button_present(self, lc, i))) { place_button(self, lc, bwidth, left, i, &x, &self->max_on, &self->max_x);
self->label_width -= bwidth;
if (i > 0) self->max_x = x;
x += i * bwidth;
if (i < 0) self->max_x = x;
}
} else if (*lc == 'C') { } else if (*lc == 'C') {
if (firstcon) *firstcon = OB_FRAME_CONTEXT_CLOSE; if (firstcon) *firstcon = OB_FRAME_CONTEXT_CLOSE;
if ((self->close_on = is_button_present(self, lc, i))) { place_button(self, lc, bwidth, left, i, &x, &self->close_on, &self->close_x);
self->label_width -= bwidth;
if (i > 0) self->close_x = x;
x += i * bwidth;
if (i < 0) self->close_x = x;
}
} else } else
continue; /* don't set firstcon */ continue; /* don't set firstcon */
firstcon = NULL; firstcon = NULL;
@ -1276,8 +1268,7 @@ static void layout_title(ObFrame *self)
} else } else
XUnmapWindow(obt_display, self->close); XUnmapWindow(obt_display, self->close);
if (self->label_on) { if (self->label_on && self->label_width > 0) {
self->label_width = MAX(1, self->label_width); /* no lower than 1 */
XMapWindow(obt_display, self->label); XMapWindow(obt_display, self->label);
XMoveWindow(obt_display, self->label, self->label_x, XMoveWindow(obt_display, self->label, self->label_x,
ob_rr_theme->paddingy); ob_rr_theme->paddingy);

View file

@ -324,4 +324,3 @@ void keyboard_shutdown(gboolean reconfig)
popup_free(popup); popup_free(popup);
popup = NULL; popup = NULL;
} }

View file

@ -42,5 +42,4 @@ void tree_assimilate(KeyBindingTree *node);
KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict); KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict);
gboolean tree_chroot(KeyBindingTree *tree, GList *keylist); gboolean tree_chroot(KeyBindingTree *tree, GList *keylist);
#endif #endif

View file

@ -58,7 +58,6 @@ static gunichar parse_shortcut(const gchar *label, gboolean allow_shortcut,
gchar **strippedlabel, guint *position, gchar **strippedlabel, guint *position,
gboolean *always_show); gboolean *always_show);
static void client_dest(ObClient *client, gpointer data) static void client_dest(ObClient *client, gpointer data)
{ {
/* menus can be associated with a client, so close any that are since /* menus can be associated with a client, so close any that are since

View file

@ -701,7 +701,6 @@ void menu_frame_render(ObMenuFrame *self)
XSetWindowBorder(obt_display, e->window, XSetWindowBorder(obt_display, e->window,
RrColorPixel(ob_rr_theme->menu_border_color)); RrColorPixel(ob_rr_theme->menu_border_color));
text_a = (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL && text_a = (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
!e->entry->data.normal.enabled ? !e->entry->data.normal.enabled ?
/* disabled */ /* disabled */
@ -1091,7 +1090,6 @@ void menu_frame_hide_all_client(ObClient *client)
} }
} }
ObMenuFrame* menu_frame_under(gint x, gint y) ObMenuFrame* menu_frame_under(gint x, gint y)
{ {
ObMenuFrame *ret = NULL; ObMenuFrame *ret = NULL;

View file

@ -352,7 +352,6 @@ static void do_move(gboolean keyboard, gint keydist)
moveresize_client->frame->area.y); moveresize_client->frame->area.y);
} }
static void do_resize(void) static void do_resize(void)
{ {
gint x, y, w, h, lw, lh; gint x, y, w, h, lw, lh;

View file

@ -292,7 +292,6 @@ static void prompt_layout(ObPrompt *self)
self->button[i].width = MAX(self->button[i].width, bw); self->button[i].width = MAX(self->button[i].width, bw);
self->button[i].height = MAX(self->button[i].height, bh); self->button[i].height = MAX(self->button[i].height, bh);
self->button[i].width += BUTTON_HMARGIN * 2; self->button[i].width += BUTTON_HMARGIN * 2;
self->button[i].height += BUTTON_VMARGIN * 2; self->button[i].height += BUTTON_VMARGIN * 2;

View file

@ -401,7 +401,6 @@ static void sm_save_yourself_2(SmcConn conn, SmPointer data)
SmcSaveYourselfDone(conn, success); SmcSaveYourselfDone(conn, success);
} }
static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type, static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type,
Bool shutdown, gint interact_style, Bool fast) Bool shutdown, gint interact_style, Bool fast)
{ {

View file

@ -659,7 +659,6 @@ static void gradient_vertical(RrSurface *sf, gint w, gint h)
} }
} }
static void gradient_diagonal(RrSurface *sf, gint w, gint h) static void gradient_diagonal(RrSurface *sf, gint w, gint h)
{ {
gint x, y; gint x, y;

View file

@ -333,7 +333,6 @@ void RrAppearanceFree(RrAppearance *a)
} }
} }
static void pixel_data_to_pixmap(RrAppearance *l, static void pixel_data_to_pixmap(RrAppearance *l,
gint x, gint y, gint w, gint h) gint x, gint y, gint w, gint h)
{ {

View file

@ -90,7 +90,6 @@ gint main()
exit (0); exit (0);
#endif #endif
RrPaint(look, win, w, h); RrPaint(look, win, w, h);
done = 0; done = 0;
while (!done) { while (!done) {

View file

@ -577,7 +577,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
theme->def_win_icon_w = OB_DEFAULT_ICON_WIDTH; theme->def_win_icon_w = OB_DEFAULT_ICON_WIDTH;
theme->def_win_icon_h = OB_DEFAULT_ICON_HEIGHT; theme->def_win_icon_h = OB_DEFAULT_ICON_HEIGHT;
/* read the decoration textures */ /* read the decoration textures */
if (!read_appearance(db, inst, if (!read_appearance(db, inst,
"window.active.title.bg", theme->a_focused_title, "window.active.title.bg", theme->a_focused_title,
@ -1780,7 +1779,6 @@ static void parse_appearance(gchar *tex, RrSurfaceColorType *grad,
*interlaced = FALSE; *interlaced = FALSE;
} }
static gboolean read_appearance(XrmDatabase db, const RrInstance *inst, static gboolean read_appearance(XrmDatabase db, const RrInstance *inst,
const gchar *rname, RrAppearance *value, const gchar *rname, RrAppearance *value,
gboolean allow_trans) gboolean allow_trans)

View file

@ -66,7 +66,6 @@ int main () {
PropModeReplace, (unsigned char*)&num, 1); PropModeReplace, (unsigned char*)&num, 1);
XFlush(display); XFlush(display);
while (1) { while (1) {
XNextEvent(display, &report); XNextEvent(display, &report);
} }