client: remove internal geometry

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-10-07 14:24:39 +02:00
parent c94f7b6767
commit 4ef5e816ec
3 changed files with 11 additions and 47 deletions

15
event.c
View File

@ -262,7 +262,7 @@ event_handle_configurerequest(void *data __attribute__ ((unused)),
if((c = client_getbywin(ev->window)))
{
area_t geometry = c->geometries.internal;
area_t geometry = c->geometry;
if(ev->value_mask & XCB_CONFIG_WINDOW_X)
geometry.x = ev->x;
@ -280,22 +280,9 @@ event_handle_configurerequest(void *data __attribute__ ((unused)),
lua_pop(globalconf.L, 1);
}
/* Clients are not allowed to directly mess with stacking parameters. */
ev->value_mask &= ~(XCB_CONFIG_WINDOW_SIBLING |
XCB_CONFIG_WINDOW_STACK_MODE);
/** Configure request are sent with size relative to real (internal)
* window size, i.e. without borders. */
geometry.width += 2 * c->border_width;
geometry.height += 2 * c->border_width;
if(!client_resize(c, geometry, false))
{
geometry.width -= 2 * c->border_width;
geometry.height -= 2 * c->border_width;
xwindow_configure(c->window, geometry, c->border_width);
}
}
else
event_handle_configurerequest_configure_window(ev);

View File

@ -452,7 +452,6 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen,
* been set. */
#define HANDLE_GEOM(attr) \
c->geometry.attr = wgeom->attr; \
c->geometries.internal.attr = wgeom->attr; \
luaA_object_emit_signal(globalconf.L, -1, "property::" #attr, 0);
HANDLE_GEOM(x)
HANDLE_GEOM(y)
@ -656,39 +655,19 @@ client_resize(client_t *c, area_t geometry, bool hints)
if(geometry.y + geometry.height < 0)
geometry.y = 0;
area_t geometry_internal = { .x = geometry.x,
.y = geometry.y,
.width = geometry.width - 2 * c->border_width,
.height = geometry.height - 2 * c->border_width };
if(hints)
geometry_internal = client_geometry_hints(c, geometry_internal);
geometry = client_geometry_hints(c, geometry);
if(geometry_internal.width == 0 || geometry_internal.height == 0)
if(geometry.width == 0 || geometry.height == 0)
return false;
/* Also let client hints propagate to the "official" geometry. */
geometry.x = geometry_internal.x;
geometry.y = geometry_internal.y;
geometry.width = geometry_internal.width + 2 * c->border_width;
geometry.height = geometry_internal.height + 2 * c->border_width;
if(c->geometries.internal.x != geometry_internal.x
|| c->geometries.internal.y != geometry_internal.y
|| c->geometries.internal.width != geometry_internal.width
|| c->geometries.internal.height != geometry_internal.height)
if(c->geometry.x != geometry.x
|| c->geometry.y != geometry.y
|| c->geometry.width != geometry.width
|| c->geometry.height != geometry.height)
{
screen_t *new_screen = screen_getbycoord(c->screen,
geometry_internal.x, geometry_internal.y);
/* Values to configure a window is an array where values are
* stored according to 'value_mask' */
uint32_t values[4];
c->geometries.internal.x = values[0] = geometry_internal.x;
c->geometries.internal.y = values[1] = geometry_internal.y;
c->geometries.internal.width = values[2] = geometry_internal.width;
c->geometries.internal.height = values[3] = geometry_internal.height;
geometry.x, geometry.y);
/* Also store geometry including border */
c->geometry = geometry;
@ -699,7 +678,7 @@ client_resize(client_t *c, area_t geometry, bool hints)
xcb_configure_window(globalconf.connection, c->window,
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
| XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
values);
(uint32_t[]) { geometry.x, geometry.y, geometry.width, geometry.height });
client_restore_enterleave_events();
@ -1490,8 +1469,8 @@ luaA_client_get_content(lua_State *L, client_t *c)
xcb_image_t *ximage = xcb_image_get(globalconf.connection,
c->window,
0, 0,
c->geometries.internal.width,
c->geometries.internal.height,
c->geometry.width,
c->geometry.height,
~0, XCB_IMAGE_FORMAT_Z_PIXMAP);
int retval = 0;

View File

@ -76,8 +76,6 @@ struct client_t
area_t fullscreen;
/** Client geometry when (un)-max */
area_t max;
/** Internal geometry (matching X11 protocol) */
area_t internal;
} geometries;
/** Pre-fullscreen border width */
int border_width_fs;