handle passed output resource for xdg-shell fullscreen request

This commit is contained in:
Mike Blumenkrantz 2018-01-08 11:13:36 -05:00
parent 7dcc295e6b
commit 5cc08794ee
3 changed files with 17 additions and 1 deletions

View File

@ -1392,6 +1392,10 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
"min surface height cannot be larger than max surface height");
if (ec->comp_data->shell.set.fullscreen && (!ec->fullscreen))
{
E_Zone *zone = e_comp_zone_id_get(ec->comp_data->shell.set.fs_zone);
if (zone && (zone != ec->zone))
e_client_zone_set(ec, zone);
e_client_fullscreen(ec, E_FULLSCREEN_RESIZE);
}
if (ec->comp_data->shell.set.unfullscreen)

View File

@ -325,6 +325,7 @@ struct _E_Comp_Wl_Client_Data
Eina_Bool maximize E_BITFIELD;
Eina_Bool unmaximize E_BITFIELD;
Eina_Bool minimize E_BITFIELD;
int fs_zone;
} set;
} shell;
struct

View File

@ -582,7 +582,7 @@ _e_xdg_toplevel_cb_maximized_unset(struct wl_client *client EINA_UNUSED, struct
}
static void
_e_xdg_toplevel_cb_fullscreen_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource EINA_UNUSED)
_e_xdg_toplevel_cb_fullscreen_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource)
{
E_Client *ec;
@ -596,6 +596,17 @@ _e_xdg_toplevel_cb_fullscreen_set(struct wl_client *client EINA_UNUSED, struct w
}
if (ec->lock_user_fullscreen) return;
if (output_resource)
{
Eina_List *l;
E_Zone *zone;
E_Comp_Wl_Output *wlo = wl_resource_get_user_data(output_resource);
EINA_LIST_FOREACH(e_comp->zones, l, zone)
if (zone->output == wlo)
ec->comp_data->shell.set.fs_zone = zone->id;
}
else
ec->comp_data->shell.set.fs_zone = ec->zone->id;
_xdg_shell_surface_send_configure(resource, 1, !!ec->maximized || ec->comp_data->max, 0, ec->zone->w, ec->zone->h);
}