[PATCH 02/12] shell.c: Restore maximized and fullscreen window on destroyed output

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Tue Mar 18 01:21:52 PDT 2014


On 03/18/2014 07:39 AM, Zhang, Xiong Y wrote:
> On Mon, 2014-03-17 at 19:17 +0200, Ander Conselvan de Oliveira wrote:
>> On 03/07/2014 10:27 AM, Xiong Zhang wrote:
>> > When maximized or fullscreen window is on destroyed output, compositor
>> > can't change these windows to normal window without notify client,
>> > otherwise maximize icon or F11 buttion lose its effect after output unplug.
>> >
>> > Instead we keep these window as maximized or fullscreen, just change
>> > it's size to target output.
>>
>> I'm not sure about this. xdg-shell lets us handle this properly and
>> wl_shell should be deprecated at some point, so I'm more inclined to
>> keep the current behavior.
>
>>
>> Cheers,
>> Ander
>>
> yes, using xdg-shell, maximize icon and F11 button can take effect after
> output unplug.
> But server secretly changes window's state from maximized to unmaximized
> without notifying client, it's unreasonable.

What I meant is that xdg-shell provides mechanism to notify the client 
if it looses the maximized or fullscreen state. If I understand 
correctly, xdg-shell is an attempt to do wl_shell right and once it is 
finished wl_shell will be deprecated. So in my understanding, as long as 
we do the right thing with xdg-shell we are OK.

But as I said, I'm not sure. I don't like the behavior of taking a 
fullscreen surface from an unplugged output and making it fullscreen in 
another output. I'd prefer to unfullscreen it. But if we must do 
something sensible with wl_shell, then I guess this is the way to go.

Cheers,
Ander

> If the unplugged output is
> much larger than remaining output, the maximized window can't been fully
> displayed on remaining output when the output of maximized window is
> unplugged. In order to restore this window to normal, user must move
> this window to see the maximize icon. It isn't convenient for user.
>
> thanks.
>> >
>> > Signed-off-by: Xiong Zhang <xiong.y.zhang at intel.com  <mailto:xiong.y.zhang at intel.com>>
>> > ---
>> >   desktop-shell/shell.c | 24 +++++++++++++++++++++---
>> >   1 file changed, 21 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
>> > index bee1b0b..02dd1b8 100644
>> > --- a/desktop-shell/shell.c
>> > +++ b/desktop-shell/shell.c
>> > @@ -5534,6 +5534,7 @@ shell_reposition_view_on_output_destroy(struct weston_view *view)
>> >   	struct shell_surface *shsurf;
>> >   	float x, y;
>> >   	int visible;
>> > +	struct weston_view *black_view;
>> >
>> >   	x = view->geometry.x;
>> >   	y = view->geometry.y;
>> > @@ -5557,6 +5558,8 @@ shell_reposition_view_on_output_destroy(struct weston_view *view)
>> >   		x = first_output->x + first_output->width / 4;
>> >   		y = first_output->y + first_output->height / 4;
>> >
>> > +		output = first_output;
>> > +
>> >   		weston_view_set_position(view, x, y);
>> >   	} else
>> >   		weston_view_geometry_dirty(view);
>> > @@ -5566,9 +5569,24 @@ shell_reposition_view_on_output_destroy(struct weston_view *view)
>> >
>> >   	if (shsurf) {
>> >   		shsurf->saved_position_valid = false;
>> > -		shsurf->next_state.maximized = false;
>> > -		shsurf->next_state.fullscreen = false;
>> > -		shsurf->state_changed = true;
>> > +
>> > +		/* Resize maxmized window to target output. */
>> > +		if (shsurf->state.maximized)
>> > +			set_maximized(shsurf, output);
>> > +
>> > +		/* Resize fullscreen window to target output. */
>> > +		if (shsurf->state.fullscreen) {
>> > +			black_view = shsurf->fullscreen.black_view->surface;
>> > +			weston_surface_destroy(black_view->surface);
>> > +			shsurf->fullscreen.black_view = NULL;
>> > +
>> > +			set_fullscreen(shsurf,
>> > +				       shsurf->fullscreen.type,
>> > +				       shsurf->fullscreen.framerate,
>> > +				       output);
>> > +		}
>> > +
>> > +		shsurf->state_changed = false;
>> >   	}
>> >   }
>> >
>> >
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org  <mailto:wayland-devel at lists.freedesktop.org>
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


More information about the wayland-devel mailing list