forked from enlightenment/enlightenment
apply csd sizing transform for wayland configure events
when not resizing, the sizes passed to configure should be based on the window size and not the surface size. in order to calculate this, it's necessary to keep track of the last-known window geometry for non-maximized states and create offsets with which to calculate new sizes this fixes directional maximizes as well as unmaximizing
This commit is contained in:
parent
9e4fe82fbc
commit
0d19a5914b
|
@ -1096,6 +1096,14 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
|
||||||
ec->ignored = ignored;
|
ec->ignored = ignored;
|
||||||
if (!ec->comp_data->mapped) goto unmapped;
|
if (!ec->comp_data->mapped) goto unmapped;
|
||||||
|
|
||||||
|
if (ec->comp_data->shell.surface && ec->comp_data->shell.configure_send && (!ec->maximized) && (!ec->fullscreen))
|
||||||
|
{
|
||||||
|
ec->comp_data->shell.window_offsets.l = ec->comp_data->shell.window.x;
|
||||||
|
ec->comp_data->shell.window_offsets.r = ec->client.w - ec->comp_data->shell.window.w - ec->comp_data->shell.window.x;
|
||||||
|
ec->comp_data->shell.window_offsets.t = ec->comp_data->shell.window.y;
|
||||||
|
ec->comp_data->shell.window_offsets.b = ec->client.h - ec->comp_data->shell.window.h - ec->comp_data->shell.window.y;
|
||||||
|
}
|
||||||
|
|
||||||
/* put state damages into surface */
|
/* put state damages into surface */
|
||||||
if ((!e_comp->nocomp) && (ec->frame))
|
if ((!e_comp->nocomp) && (ec->frame))
|
||||||
{
|
{
|
||||||
|
|
|
@ -261,6 +261,10 @@ struct _E_Comp_Wl_Client_Data
|
||||||
void (*map)(struct wl_resource *resource);
|
void (*map)(struct wl_resource *resource);
|
||||||
void (*unmap)(struct wl_resource *resource);
|
void (*unmap)(struct wl_resource *resource);
|
||||||
Eina_Rectangle window;
|
Eina_Rectangle window;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
int l, r, t, b;
|
||||||
|
} window_offsets;
|
||||||
} shell;
|
} shell;
|
||||||
|
|
||||||
E_Comp_Wl_Buffer_Ref buffer_ref;
|
E_Comp_Wl_Buffer_Ref buffer_ref;
|
||||||
|
|
|
@ -620,6 +620,12 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
|
||||||
if (ec->focused)
|
if (ec->focused)
|
||||||
_e_xdg_surface_state_add(resource, &states, XDG_SURFACE_STATE_ACTIVATED);
|
_e_xdg_surface_state_add(resource, &states, XDG_SURFACE_STATE_ACTIVATED);
|
||||||
|
|
||||||
|
if ((!ec->maximized) && (!ec->fullscreen) && (!e_client_util_resizing_get(ec)))
|
||||||
|
{
|
||||||
|
width -= ec->comp_data->shell.window_offsets.l + ec->comp_data->shell.window_offsets.r;
|
||||||
|
height -= ec->comp_data->shell.window_offsets.t + ec->comp_data->shell.window_offsets.b;
|
||||||
|
}
|
||||||
|
|
||||||
if (ec->netwm.type != E_WINDOW_TYPE_POPUP_MENU)
|
if (ec->netwm.type != E_WINDOW_TYPE_POPUP_MENU)
|
||||||
{
|
{
|
||||||
serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
|
serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
|
||||||
|
|
Loading…
Reference in New Issue