From ef7a08b100128a9a31f042ea6af8207b8be52d4d Mon Sep 17 00:00:00 2001 From: Benoit Gschwind Date: Fri, 22 Feb 2008 00:14:30 +0100 Subject: [PATCH] Update signature of frame_get_size, frame_get_window_area, frame_update_layout --- engines/default/plugin.c | 12 ++--- engines/default/plugin.h | 7 +-- openbox/actions/moveresizeto.c | 6 ++- openbox/actions/resize.c | 6 ++- openbox/client.c | 79 ++++++++++++++++++++------------- openbox/client_menu.c | 6 ++- openbox/engine_interface.c | 12 +++-- openbox/engine_interface.h | 6 +-- openbox/event.c | 15 ++++--- openbox/focus_cycle.c | 6 ++- openbox/focus_cycle_indicator.c | 3 +- openbox/moveresize.c | 17 ++++--- openbox/openbox.c | 2 +- openbox/place.c | 24 ++++++---- openbox/resist.c | 18 +++++--- openbox/screen.c | 4 +- openbox/stacking.c | 12 +++-- 17 files changed, 148 insertions(+), 87 deletions(-) diff --git a/engines/default/plugin.c b/engines/default/plugin.c index cc3c1631..a3ffa314 100644 --- a/engines/default/plugin.c +++ b/engines/default/plugin.c @@ -660,21 +660,23 @@ void frame_set_decorations(gpointer self, ObFrameDecorations d) OBDEFAULTFRAME(self)->decorations = d; } -Rect frame_get_window_area(gpointer self) +void frame_get_window_area(gpointer self, Rect * r) { - return OBDEFAULTFRAME(self)->area; + /* *r = (OBDEFAULTFRAME(self)->area) ??? */ + memcpy(r, &(OBDEFAULTFRAME(self)->area), sizeof(Rect)); } void frame_set_client_area(gpointer self, Rect r) { OBDEFAULTFRAME(self)->client_area = r; } -void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) +void frame_update_layout(gpointer _self, Rect area, gboolean is_resize, gboolean is_fake) { ObDefaultFrame * self = (ObDefaultFrame *) _self; Strut oldsize; oldsize = self->size; + self->client_area = area; self->area = self->client_area; /* do this before changing the frame's status like max_horz max_vert */ @@ -1174,9 +1176,9 @@ Window frame_get_window(gpointer self) return OBDEFAULTFRAME(self)->window; } -Strut frame_get_size(gpointer self) +void frame_get_size(gpointer self, Strut * s) { - return OBDEFAULTFRAME(self)->size; + memcpy(s, &(OBDEFAULTFRAME(self)->size), sizeof(Strut)); } gint frame_get_decorations(gpointer self) diff --git a/engines/default/plugin.h b/engines/default/plugin.h index bf13e3e0..b3627250 100644 --- a/engines/default/plugin.h +++ b/engines/default/plugin.h @@ -177,7 +177,7 @@ void frame_set_is_max_vert(gpointer, gboolean); void frame_set_is_max_horz(gpointer, gboolean); void frame_set_is_shaded(gpointer, gboolean); -void frame_update_layout(gpointer, gboolean, gboolean); +void frame_update_layout(gpointer, Rect, gboolean, gboolean); void frame_adjust_client_area(gpointer self); void frame_adjust_state(gpointer self); void frame_adjust_focus(gpointer self, gboolean hilite); @@ -194,8 +194,9 @@ void frame_set_press_flag(gpointer, ObFrameButton); Window frame_get_window(gpointer); -Strut frame_get_size(gpointer self); -Rect frame_get_area(gpointer self); +void frame_get_size(gpointer self, Strut *); +void frame_get_area(gpointer self, Rect *); + gint frame_get_decorations(gpointer self); void frame_update_title(gpointer, const gchar *); diff --git a/openbox/actions/moveresizeto.c b/openbox/actions/moveresizeto.c index a41fcfb4..02e1c255 100644 --- a/openbox/actions/moveresizeto.c +++ b/openbox/actions/moveresizeto.c @@ -126,8 +126,10 @@ static gboolean run_func(ObActionsData *data, gpointer options) y = c->area.y; client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE); - Strut c_size = frame_engine->frame_get_size(c->frame); - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Strut c_size; + frame_engine->frame_get_size(c->frame, &c_size); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); /* get the frame's size */ w += c_size.left + c_size.right; h += c_size.top + c_size.bottom; diff --git a/openbox/actions/resize.c b/openbox/actions/resize.c index f46c0c4b..e6166c83 100644 --- a/openbox/actions/resize.c +++ b/openbox/actions/resize.c @@ -67,8 +67,10 @@ static gboolean run_func(ObActionsData *data, gpointer options) ObClient *c = data->client; guint32 corner; - Strut c_size = frame_engine->frame_get_size(c->frame); - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Strut c_size; + frame_engine->frame_get_size(c->frame, &c_size); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); if (!data->button) corner = OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_KEYBOARD); else if (o->corner_specified) diff --git a/openbox/client.c b/openbox/client.c index 4f6f78a0..0b5f1733 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -316,13 +316,12 @@ void client_manage(Window window, ObPrompt *prompt) /* adjust the frame to the client's size before showing or placing the window */ - frame_engine->frame_set_client_area (self->frame, self->area); frame_engine->frame_set_hover_flag (self->frame, OB_BUTTON_NONE); frame_engine->frame_set_press_flag (self->frame, OB_BUTTON_NONE); frame_engine->frame_set_is_focus (self->frame, FALSE); frame_engine->frame_set_decorations (self->frame, self->decorations); frame_engine->frame_update_title (self->frame, self->title); - frame_engine->frame_update_layout (self->frame, FALSE, TRUE); + frame_engine->frame_update_layout (self->frame, self->area, FALSE, TRUE); frame_engine->frame_update_skin (self->frame); /* where the frame was placed is where the window was originally */ @@ -403,7 +402,8 @@ void client_manage(Window window, ObPrompt *prompt) { Rect *a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &place); - Strut size = frame_engine->frame_get_size(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); /* get the size of the frame */ place.width += size.left + size.right; place.height += size.top + size.bottom; @@ -642,12 +642,14 @@ ObClient *client_fake_manage(Window window) self->frame = frame_engine->frame_new(self, self->w_client, self->w_frame); frame_engine->frame_set_decorations (self->frame, self->decorations); frame_engine->frame_update_title (self->frame, self->title); - frame_engine->frame_update_layout (self->frame, FALSE, FALSE); + frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE); frame_engine->frame_update_skin (self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); ob_debug("gave extents left %d right %d top %d bottom %d", - frame_engine->frame_get_size(self->frame).left, frame_engine->frame_get_size(self->frame).right, - frame_engine->frame_get_size(self->frame).top, frame_engine->frame_get_size(self->frame).bottom); + size.left, size.right, + size.top, size.bottom); /* free the ObAppSettings shallow copy */ g_free(settings); @@ -1015,7 +1017,8 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h, /* get where the frame would be */ frame_client_gravity(self, x, y); - Strut size = frame_engine->frame_get_size(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); /* get the requested size of the window with decorations */ fw = size.left + w + size.right; @@ -1028,7 +1031,8 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h, Point newtl, newtr, newbl, newbr; gboolean stationary_l, stationary_r, stationary_t, stationary_b; - Rect area = frame_engine->frame_get_window_area(self->frame); + Rect area; + frame_engine->frame_get_window_area(self->frame, &area); POINT_SET(oldtl, area.x, area.y); POINT_SET(oldbr, area.x + area.width - 1, area.y + area.height - 1); @@ -2431,7 +2435,7 @@ static void client_change_state(ObClient *self) OBT_PROP_SETA32(self->w_client, NET_WM_STATE, ATOM, netstate, num); if (self->frame) - frame_engine->frame_update_layout (self->frame, FALSE, FALSE); + frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE); } ObClient *client_search_focus_tree(ObClient *self) @@ -2772,9 +2776,8 @@ static void client_apply_startup_state(ObClient *self, not, so this needs to be called even if we have fullscreened/maxed */ self->area = oldarea; - frame_engine->frame_set_client_area (self->frame, self->area); frame_engine->frame_set_decorations (self->frame, self->decorations); - frame_engine->frame_update_layout (self->frame, FALSE, FALSE); + frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE); client_configure(self, x, y, w, h, FALSE, TRUE, FALSE); /* set the desktop hint, to make sure that it always exists */ @@ -2858,7 +2861,7 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, anything visible for real, this way the constraints below can work with the updated frame dimensions. */ frame_engine->frame_set_decorations (self->frame, self->decorations); - frame_engine->frame_update_layout (self->frame, FALSE, TRUE); + frame_engine->frame_update_layout (self->frame, self->area, FALSE, TRUE); /* gets the frame's position */ frame_client_gravity(self, x, y); @@ -2891,7 +2894,8 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, a = screen_area(self->desktop, i, (self->max_horz && self->max_vert ? NULL : &desired)); - Strut size = frame_engine->frame_get_size(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); /* set the size and position if maximized */ if (self->max_horz) { *x = a->x; @@ -3031,8 +3035,10 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gboolean fvert = frame_engine->frame_is_max_vert(self->frame); gint logicalw, logicalh; - Strut size = frame_engine->frame_get_size(self->frame); - Rect area = frame_engine->frame_get_window_area(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); + Rect area; + frame_engine->frame_get_window_area(self->frame, &area); /* find the new x, y, width, and height (and logical size) */ client_try_configure(self, &x, &y, &w, &h, &logicalw, &logicalh, user); @@ -3047,7 +3053,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, oldw = self->area.width; oldh = self->area.height; - oldframe = frame_engine->frame_get_window_area(self->frame); + frame_engine->frame_get_window_area(self->frame, &oldframe); RECT_SET(self->area, x, y, w, h); frame_engine->frame_set_client_area (self->frame, self->area); @@ -3062,7 +3068,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, /* if the client is enlarging, then resize the client before the frame */ if (send_resize_client && (w > oldw || h > oldh)) { frame_engine->frame_set_decorations (self->frame, self->decorations); - frame_engine->frame_update_layout (self->frame, FALSE, FALSE); + frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE); } /* find the frame's dimensions and move/resize it */ @@ -3087,7 +3093,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, mouse_replay_pointer(); frame_engine->frame_set_decorations (self->frame, self->decorations); - frame_engine->frame_update_layout (self->frame, TRUE, FALSE); + frame_engine->frame_update_layout (self->frame, self->area, TRUE, FALSE); if (!user) event_end_ignore_all_enters(ignore_start); @@ -3152,14 +3158,15 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, */ if (send_resize_client && (w <= oldw || h <= oldh)) { frame_engine->frame_set_decorations (self->frame, self->decorations); - frame_engine->frame_update_layout (self->frame, FALSE, FALSE); + frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE); } XFlush(obt_display); /* if it moved between monitors, then this can affect the stacking layer of this window or others - for fullscreen windows */ - Rect current_frame = frame_engine->frame_get_window_area(self->frame); + Rect current_frame; + frame_engine->frame_get_window_area(self->frame, ¤t_frame); if (screen_find_monitor(¤t_frame) != screen_find_monitor(&oldframe)) { @@ -3372,7 +3379,7 @@ void client_shade(ObClient *self, gboolean shade) client_change_wm_state(self); /* the window is being hidden/shown */ /* resize the frame to just the titlebar */ frame_engine->frame_set_is_shaded (self->frame, self->shaded); - frame_engine->frame_update_layout(self->frame, FALSE, FALSE); + frame_engine->frame_update_layout(self->frame, self->area, FALSE, FALSE); } static void client_ping_event(ObClient *self, gboolean dead) @@ -3525,7 +3532,7 @@ static void client_set_desktop_recursive(ObClient *self, OBT_PROP_SET32(self->w_client, NET_WM_DESKTOP, CARDINAL, target); /* the frame can display the current desktop state */ frame_engine->frame_set_decorations (self->frame, self->decorations); - frame_engine->frame_update_layout(self->frame, FALSE, FALSE); + frame_engine->frame_update_layout(self->frame, self->area, FALSE, FALSE); /* 'move' the window to the new desktop */ if (!donthide) client_hide(self); @@ -4022,7 +4029,8 @@ void client_set_undecorated(ObClient *self, gboolean undecorated) guint client_monitor(ObClient *self) { - Rect area = frame_engine->frame_get_window_area(self->frame); + Rect area; + frame_engine->frame_get_window_area(self->frame, &area); return screen_find_monitor(&area); } @@ -4218,8 +4226,10 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, Rect dock_area; gint edge; - Strut size = frame_engine->frame_get_size(self->frame); - Rect area = frame_engine->frame_get_window_area(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); + Rect area; + frame_engine->frame_get_window_area(self->frame, &area); a = screen_area(self->desktop, SCREEN_AREA_ALL_MONITORS, &area); @@ -4272,7 +4282,9 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, ob_debug("trying window %s", cur->title); - detect_edge(frame_engine->frame_get_window_area(cur->frame), dir, my_head, my_size, my_edge_start, + Rect area; + frame_engine->frame_get_window_area(self->frame, &area); + detect_edge(area, dir, my_head, my_size, my_edge_start, my_edge_size, dest, near_edge); } dock_get_area(&dock_area); @@ -4290,7 +4302,8 @@ void client_find_move_directional(ObClient *self, ObDirection dir, gboolean near; - Rect area = frame_engine->frame_get_window_area(self->frame); + Rect area; + frame_engine->frame_get_window_area(self->frame, &area); switch (dir) { case OB_DIRECTION_EAST: @@ -4361,8 +4374,10 @@ void client_find_resize_directional(ObClient *self, ObDirection side, gboolean near; ObDirection dir; - Rect area = frame_engine->frame_get_window_area(self->frame); - Strut size = frame_engine->frame_get_size(self->frame); + Rect area; + frame_engine->frame_get_window_area(self->frame, &area); + Strut size; + frame_engine->frame_get_size(self->frame, &size); switch (side) { case OB_DIRECTION_EAST: @@ -4446,13 +4461,15 @@ ObClient* client_under_pointer(void) for (it = stacking_list; it; it = g_list_next(it)) { if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = WINDOW_AS_CLIENT(it->data); + Rect area; + frame_engine->frame_get_window_area(c->frame, &area); if (frame_engine->frame_is_visible(c->frame) && /* check the desktop, this is done during desktop switching and windows are shown/hidden status is not reliable */ (c->desktop == screen_desktop || c->desktop == DESKTOP_ALL) && - RECT_CONTAINS(frame_engine->frame_get_window_area(c->frame), x, y)) + RECT_CONTAINS(area, x, y)) { ret = c; break; @@ -4471,7 +4488,7 @@ gboolean client_has_group_siblings(ObClient *self) void client_show_frame(ObClient * self) { frame_engine->frame_set_is_visible(self->frame, TRUE); - frame_engine->frame_update_layout(self->frame, FALSE, FALSE); + frame_engine->frame_update_layout(self->frame, self->area, FALSE, FALSE); frame_engine->frame_update_skin(self->frame); /* Grab the server to make sure that the frame window is mapped before the client gets its MapNotify, i.e. to make sure the client is diff --git a/openbox/client_menu.c b/openbox/client_menu.c index 4054f028..f629e54b 100644 --- a/openbox/client_menu.c +++ b/openbox/client_menu.c @@ -297,8 +297,10 @@ static void client_menu_place(ObMenuFrame *frame, gint *x, gint *y, if (!mouse && frame->client) { - Strut size = frame_engine->frame_get_size(frame->client->frame); - Rect area = frame_engine->frame_get_window_area(frame->client->frame); + Strut size; + frame_engine->frame_get_size(frame->client->frame, &size); + Rect area; + frame_engine->frame_get_window_area(frame->client->frame, &area); *x = area.x; diff --git a/openbox/engine_interface.c b/openbox/engine_interface.c index 8f55d92b..cc2ca022 100644 --- a/openbox/engine_interface.c +++ b/openbox/engine_interface.c @@ -288,7 +288,8 @@ ObFrameContext plugin_frame_context(ObClient *client, Window win, gint x, gint y void frame_client_gravity(ObClient *self, gint *x, gint *y) { - Strut size = frame_engine->frame_get_size(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); /* horizontal */ switch (self->gravity) { default: @@ -350,7 +351,8 @@ void frame_client_gravity(ObClient *self, gint *x, gint *y) void frame_frame_gravity(ObClient *self, gint *x, gint *y) { - Strut size = frame_engine->frame_get_size(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); /* horizontal */ switch (self->gravity) { default: @@ -406,7 +408,8 @@ void frame_frame_gravity(ObClient *self, gint *x, gint *y) void frame_rect_to_frame(ObClient * self, Rect *r) { - Strut size = frame_engine->frame_get_size(self->frame); + Strut size; + frame_engine->frame_get_size(self->frame, &size); r->width += size.left + size.right; r->height += size.top + size.bottom; frame_client_gravity(self, &r->x, &r->y); @@ -414,7 +417,8 @@ void frame_rect_to_frame(ObClient * self, Rect *r) void frame_rect_to_client(ObClient * self, Rect *r) { - Strut size = frame_engine->frame_get_size(self); + Strut size; + frame_engine->frame_get_size(self, &size); r->width -= size.left + size.right; r->height -= size.top + size.bottom; frame_frame_gravity(self, &r->x, &r->y); diff --git a/openbox/engine_interface.h b/openbox/engine_interface.h index 04637da2..ce67be62 100644 --- a/openbox/engine_interface.h +++ b/openbox/engine_interface.h @@ -160,11 +160,11 @@ struct _ObFrameEngine void (*frame_update_title)(gpointer, const gchar *); /* get the current window area */ - Rect (*frame_get_window_area)(gpointer); + void (*frame_get_window_area)(gpointer, Rect *); /* set the requested client area */ void (*frame_set_client_area)(gpointer, Rect); /* Update size, move/resize windows */ - void (*frame_update_layout)(gpointer self, gboolean is_resize, + void (*frame_update_layout)(gpointer self, Rect, gboolean is_resize, gboolean is_fake); /* Update skin, color/texture windows */ void (*frame_update_skin)(gpointer); @@ -174,7 +174,7 @@ struct _ObFrameEngine Window (*frame_get_window)(gpointer); - Strut (*frame_get_size)(gpointer); + void (*frame_get_size)(gpointer, Strut *); gint (*frame_get_decorations)(gpointer); gboolean (*frame_is_visible)(gpointer); diff --git a/openbox/event.c b/openbox/event.c index e543b9b9..00dce00e 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -528,7 +528,7 @@ static void event_process(const XEvent *ec, gpointer data) from our Inferior up to us. This happens when iconifying a window with RevertToParent focus */ frame_engine->frame_set_is_focus(client->frame, FALSE); - frame_engine->frame_update_layout (client->frame, FALSE, FALSE); + frame_engine->frame_update_layout (client->frame, client->area, FALSE, FALSE); frame_engine->frame_update_skin(client->frame); /* focus_set_client(NULL) has already been called */ } @@ -593,7 +593,7 @@ static void event_process(const XEvent *ec, gpointer data) else if (client != focus_client) { focus_left_screen = FALSE; frame_engine->frame_set_is_focus(client->frame, TRUE); - frame_engine->frame_update_layout (client->frame, FALSE, FALSE); + frame_engine->frame_update_layout (client->frame, client->area, FALSE, FALSE); frame_engine->frame_update_skin (client->frame); focus_set_client(client); client_calc_layer(client); @@ -640,7 +640,7 @@ static void event_process(const XEvent *ec, gpointer data) if (client && client != focus_client) { frame_engine->frame_set_is_focus(client->frame, FALSE); - frame_engine->frame_update_layout (client->frame, FALSE, FALSE); + frame_engine->frame_update_layout (client->frame, client->area, FALSE, FALSE); frame_engine->frame_update_skin(client->frame); /* focus_set_client(NULL) has already been called in this section or by focus_fallback */ @@ -677,7 +677,8 @@ static void event_process(const XEvent *ec, gpointer data) gulong vals[4]; /* set the frame extents on the window */ - Strut size = frame_engine->frame_get_size(c->frame); + Strut size; + frame_engine->frame_get_size(c->frame, &size); vals[0] = size.left; vals[1] = size.right; vals[2] = size.top; @@ -1158,8 +1159,10 @@ static void event_handle_client(ObClient *client, XEvent *e) desktop. eg. open amarok window on desktop 1, switch to desktop 2, click amarok tray icon. it will move by its decoration size. */ - Strut size = frame_engine->frame_get_size(client->frame); - Rect area = frame_engine->frame_get_window_area(client->frame); + Strut size; + frame_engine->frame_get_size(client->frame, &size); + Rect area; + frame_engine->frame_get_window_area(client->frame, &area); if (x != client->area.x && x == (area.x + size.left - (gint)client->border_width) && diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index 6d73cbb0..f2146e7b 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -177,7 +177,8 @@ static ObClient *focus_find_directional(ObClient *c, ObDirection dir, if (!client_list) return NULL; - Rect area = frame_engine->frame_get_window_area(c->frame); + Rect area; + frame_engine->frame_get_window_area(c->frame, &area); /* first, find the centre coords of the currently focused window */ my_cx = area.x + area.width / 2; my_cy = area.y + area.height / 2; @@ -195,7 +196,8 @@ static ObClient *focus_find_directional(ObClient *c, ObDirection dir, desktop_windows)) continue; - Rect cur_area = frame_engine->frame_get_window_area(cur->frame); + Rect cur_area; + frame_engine->frame_get_window_area(cur->frame, &cur_area); /* find the centre coords of this window, from the * currently focused window's point of view */ his_cx = (cur_area.x - my_cx) diff --git a/openbox/focus_cycle_indicator.c b/openbox/focus_cycle_indicator.c index 5e6feee9..8e63d1ef 100644 --- a/openbox/focus_cycle_indicator.c +++ b/openbox/focus_cycle_indicator.c @@ -151,7 +151,8 @@ void focus_cycle_draw_indicator(ObClient *c) visible = FALSE; } else if (c) { - Rect area = frame_engine->frame_get_window_area(c->frame); + Rect area; + frame_engine->frame_get_window_area(c->frame, &area); /* if (c) frame_adjust_focus(c->frame, FALSE); diff --git a/openbox/moveresize.c b/openbox/moveresize.c index da087dbe..6209a815 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -98,8 +98,10 @@ static void popup_coords(ObClient *c, const gchar *format, gint a, gint b) { gchar *text; - Strut size = frame_engine->frame_get_size(c->frame); - Rect area = frame_engine->frame_get_window_area(c->frame); + Strut size; + frame_engine->frame_get_size(c->frame, &size); + Rect area; + frame_engine->frame_get_window_area(c->frame, &area); text = g_strdup_printf(format, a, b); if (config_resize_popup_pos == OB_RESIZE_POS_TOP) popup_position(popup, SouthGravity, @@ -346,9 +348,13 @@ static void do_move(gboolean keyboard, gint keydist) client_configure(moveresize_client, cur_x, cur_y, cur_w, cur_h, TRUE, FALSE, FALSE); if (config_resize_popup_show == 2) /* == "Always" */ + { + Rect area; + frame_engine->frame_get_window_area(moveresize_client->frame, &area); popup_coords(moveresize_client, "%d x %d", - frame_engine->frame_get_window_area(moveresize_client->frame).x, - frame_engine->frame_get_window_area(moveresize_client->frame).y); + area.x, + area.y); + } } @@ -480,7 +486,8 @@ static void calc_resize(gboolean keyboard, gint keydist, gint *dw, gint *dh, } - Strut size = frame_engine->frame_get_size(moveresize_client->frame); + Strut size; + frame_engine->frame_get_size(moveresize_client->frame, &size); /* resist_size_* needs the frame size */ nw += size.left + size.right; diff --git a/openbox/openbox.c b/openbox/openbox.c index e9e184c4..d1bb0f47 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -337,7 +337,7 @@ gint main(gint argc, gchar **argv) /* the new config can change the window's decorations */ client_setup_decor_and_functions(c, FALSE); /* redraw the frames */ - frame_engine->frame_update_layout (c->frame, FALSE, FALSE); + frame_engine->frame_update_layout (c->frame, c->area, FALSE, FALSE); /* the decor sizes may have changed, so the windows may end up in new positions */ client_reconfigure(c, FALSE); diff --git a/openbox/place.c b/openbox/place.c index 50117f1a..fe0aa5ab 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -149,7 +149,8 @@ static gboolean place_random(ObClient *client, gint *x, gint *y) Rect **areas; guint i; - Rect area = frame_engine->frame_get_window_area(client->frame); + Rect area; + frame_engine->frame_get_window_area(client->frame, &area); areas = pick_head(client); i = (config_place_monitor != OB_PLACE_MONITOR_ANY) ? @@ -313,7 +314,8 @@ static gboolean place_nooverlap(ObClient *c, gint *x, gint *y) */ /* don't ignore this window, so remove it from the available area */ - Rect test_area = frame_engine->frame_get_window_area(test->frame); + Rect test_area; + frame_engine->frame_get_window_area(test->frame, &test_area); spaces = area_remove(spaces, &test_area); } @@ -323,7 +325,8 @@ static gboolean place_nooverlap(ObClient *c, gint *x, gint *y) spaces = area_remove(spaces, &a); } - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); for (sit = spaces; sit; sit = g_slist_next(sit)) { Rect *r = sit->data; @@ -368,8 +371,10 @@ static gboolean place_under_mouse(ObClient *client, gint *x, gint *y) gint px, py; Rect *area; - Strut fsize = frame_engine->frame_get_size(client->frame); - Rect farea = frame_engine->frame_get_window_area(client->frame); + Strut fsize; + frame_engine->frame_get_size(client->frame, &fsize); + Rect farea; + frame_engine->frame_get_window_area(client->frame, &farea); if (!screen_pointer_pos(&px, &py)) return FALSE; @@ -419,7 +424,8 @@ static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y, g_free(areas); } - Rect farea = frame_engine->frame_get_window_area(client->frame); + Rect farea; + frame_engine->frame_get_window_area(client->frame, &farea); if (settings->position.x.center) *x = screen->x + screen->width / 2 - client->area.width / 2; else if (settings->position.x.opposite) @@ -448,7 +454,8 @@ static gboolean place_transient_splash(ObClient *client, gint *x, gint *y) gint l, r, t, b; for (it = client->parents; it; it = g_slist_next(it)) { ObClient *m = it->data; - Rect area = frame_engine->frame_get_window_area(m->frame); + Rect area; + frame_engine->frame_get_window_area(m->frame, &area); if (!m->iconic) { if (first) { l = RECT_LEFT(area); @@ -475,7 +482,8 @@ static gboolean place_transient_splash(ObClient *client, gint *x, gint *y) client->type == OB_CLIENT_TYPE_SPLASH) { Rect **areas; - Rect area = frame_engine->frame_get_window_area(client->frame); + Rect area; + frame_engine->frame_get_window_area(client->frame, &area); guint i; areas = pick_head(client); diff --git a/openbox/resist.c b/openbox/resist.c index bced072f..2daa646b 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -105,7 +105,8 @@ void resist_move_windows(ObClient *c, gint resist, gint *x, gint *y) GList *it; Rect dock_area; - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); if (!resist) return; @@ -125,7 +126,8 @@ void resist_move_windows(ObClient *c, gint resist, gint *x, gint *y) if (target->below && !c->below && target->skip_taskbar) continue; - Rect target_area = frame_engine->frame_get_window_area(target->frame); + Rect target_area; + frame_engine->frame_get_window_area(target->frame, &target_area); if (resist_move_window(c_area, target_area, resist, x, y)) break; @@ -147,7 +149,8 @@ void resist_move_monitors(ObClient *c, gint resist, gint *x, gint *y) gint w, h; /* current size */ Rect desired_area; - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); if (!resist) return; @@ -302,7 +305,8 @@ void resist_size_windows(ObClient *c, gint resist, gint *w, gint *h, ObClient *target; /* target */ Rect dock_area; - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); if (!resist) return; for (it = stacking_list; it; it = g_list_next(it)) { @@ -317,7 +321,8 @@ void resist_size_windows(ObClient *c, gint resist, gint *w, gint *h, if (target->below && !c->below && target->skip_taskbar) continue; - Rect target_area = frame_engine->frame_get_window_area(target->frame); + Rect target_area; + frame_engine->frame_get_window_area(target->frame, &target_area); if (resist_size_window(c_area, target_area, resist, w, h, dir)) break; @@ -339,7 +344,8 @@ void resist_size_monitors(ObClient *c, gint resist, gint *w, gint *h, guint i; Rect desired_area; - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); if (!resist) return; diff --git a/openbox/screen.c b/openbox/screen.c index 84b3f1d7..617923b0 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -572,7 +572,7 @@ static void screen_fallback_focus(void) /* reduce flicker by hiliting now rather than waiting for the server FocusIn event */ frame_engine->frame_set_is_focus (c->frame, TRUE); - frame_engine->frame_update_layout (c->frame, FALSE, FALSE); + frame_engine->frame_update_layout (c->frame, c->area, FALSE, FALSE); frame_engine->frame_update_skin (c->frame); /* do this here so that if you switch desktops to a window with helper windows then the helper windows won't flash */ @@ -1229,7 +1229,7 @@ void screen_show_desktop(gboolean show, ObClient *show_only) /* reduce flicker by hiliting now rather than waiting for the server FocusIn event */ frame_engine->frame_set_is_focus(c->frame, TRUE); - frame_engine->frame_update_layout (c->frame, FALSE, FALSE); + frame_engine->frame_update_layout (c->frame, c->area, FALSE, FALSE); frame_engine->frame_update_skin (c->frame); } } diff --git a/openbox/stacking.c b/openbox/stacking.c index f1a108ee..96be4aa9 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -544,7 +544,8 @@ static gboolean stacking_occluded(ObClient *client, ObClient *sibling) gboolean occluded = FALSE; gboolean found = FALSE; - Rect client_area = frame_engine->frame_get_window_area(client->frame); + Rect client_area; + frame_engine->frame_get_window_area(client->frame, &client_area); /* no need for any looping in this case */ if (sibling && client->layer != sibling->layer) return occluded; @@ -558,7 +559,8 @@ static gboolean stacking_occluded(ObClient *client, ObClient *sibling) c->desktop == client->desktop) && !client_search_transient(client, c)) { - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); if (RECT_INTERSECTS_RECT(c_area, client_area)) { if (sibling != NULL) { @@ -590,7 +592,8 @@ static gboolean stacking_occludes(ObClient *client, ObClient *sibling) gboolean occludes = FALSE; gboolean found = FALSE; - Rect client_area = frame_engine->frame_get_window_area(client->frame); + Rect client_area; + frame_engine->frame_get_window_area(client->frame, &client_area); /* no need for any looping in this case */ if (sibling && client->layer != sibling->layer) @@ -604,7 +607,8 @@ static gboolean stacking_occludes(ObClient *client, ObClient *sibling) c->desktop == client->desktop) && !client_search_transient(c, client)) { - Rect c_area = frame_engine->frame_get_window_area(c->frame); + Rect c_area; + frame_engine->frame_get_window_area(c->frame, &c_area); if (RECT_INTERSECTS_RECT(c_area, client_area)) { if (sibling != NULL) { -- 2.34.1