[PATCH][weston] desktop-shell: fix minimization of fullscreen surfaces
Derek Foreman
derekf at osg.samsung.com
Wed Sep 23 12:54:43 PDT 2015
On 23/09/15 02:40 PM, Derek Foreman wrote:
> Note: this email somehow confused patchwork and generated a new broken
> patch entry. I've deleted that, but replying here won't properly end up
> in the old patch's thread... sigh.
>
> On 20/09/15 12:10 PM, Manuel Bachmann wrote:
>> Hi folks,
>>
>> Any news on this one ? (https://patchwork.freedesktop.org/patch/46001/)
>>
>> Just tried, the problem still shows in latest master (if you fullscreen
>> weston-terminal with [F11], and then minimize wih right-click ->
>> "Minimize", the screen stays black).
>
> Right, confirmed that this happens, and that your patch fixes it...
>
>> If the implementation not seeming optimal is the root cause, I really
>> think it is the best we can achieve with a few lines and while keeping
>> the existing model. I am totally open to suggestions, though.
>>
>> ---------------------------------
>> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
>> index f7c928e..073f187 100644
>> --- a/desktop-shell/shell.c
>> +++ b/desktop-shell/shell.c
>> @@ -2667,6 +2667,11 @@ set_minimized(struct weston_surface *surface)
>> weston_layer_entry_remove(&view->layer_link);
>>
>> weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list,
>> &view->layer_link);
>>
>> + /* if this surface if fullscreen, we temporarily disable fullscreen
>> + * mode and reposition it to its previous x,y coordinates */
>> + if (shsurf->state.fullscreen)
>> + unset_fullscreen(shsurf);
>> +
>>
>> drop_focus_state(shsurf->shell, current_ws, view->surface);
>> wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {
>> if (!seat->keyboard)
>> @@ -6016,8 +6021,14 @@ switcher_next(struct switcher *switcher)
>> view->alpha = 1.0;
>>
>> shsurf = get_shell_surface(switcher->current);
>> - if (shsurf && shsurf->state.fullscreen)
>> - shsurf->fullscreen.black_view->alpha = 1.0;
>> + if (shsurf && shsurf->state.fullscreen) {
>> + /* A fullscreen surface may not be centered anymore
>> + * if unset_fullscreen() was called on it, e.g.
>> + * when minimizing it. Make sure it is again. */
>> + center_on_output(shsurf->view, shsurf->fullscreen_output);
>> + if (shsurf->fullscreen.black_view)
>> + shsurf->fullscreen.black_view->alpha = 1.0;
>> + }
>
> I'm not sure doing this in the switcher is really ok - does it get
> display mode changes right if the fullscreen app was in a different mode
> than the native mode?
>
> In testing I get segmentation faults if I start a few weston terminals,
> set one fullscreen, then minimize it with the right click menu. Then
> hold down meta and hit tab several times and let go.
>
> It seems the compositor's output list has been corrupted somehow.
Heh, I just confirmed this also happens without your patch, sorry about
that.
I'm still concerned about doing that in the switcher though - it feels
to me like we should be going through shell_configure_fullscreen() somehow.
>
>> }
>>
>> static void
>>
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
More information about the wayland-devel
mailing list