Notify clients on mode_switch()
This patch implements the notification of clients during mode_switch.
As discussed on IRC, clients are notified of mode_switch only when the
"native" mode is changed and activated. That means that if the native
mode is changed and the compositor had activated a temporary mode for
a fullscreen surface, the clients will be notified only when the native
mode is restored.
The scaling factor is treated the same way as modes.
diff --git a/src/shell.c b/src/shell.c
index c1e0109..d1847f5 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1627,11 +1627,12 @@
static void
restore_output_mode(struct weston_output *output)
{
- if (output->current != output->origin ||
- (int32_t)output->scale != output->origin_scale)
+ if (output->current_mode != output->original_mode ||
+ (int32_t)output->current_scale != output->original_scale)
weston_output_switch_mode(output,
- output->origin,
- output->origin_scale);
+ output->original_mode,
+ output->original_scale,
+ WESTON_MODE_SWITCH_RESTORE_NATIVE);
}
static void
@@ -1958,7 +1959,8 @@
surf_height * surface->buffer_scale,
shsurf->fullscreen.framerate};
- if (weston_output_switch_mode(output, &mode, surface->buffer_scale) == 0) {
+ if (weston_output_switch_mode(output, &mode, surface->buffer_scale,
+ WESTON_MODE_SWITCH_SET_TEMPORARY) == 0) {
weston_surface_set_position(surface,
output->x - surf_x,
output->y - surf_y);