/*
- * Copyright © 2019, 2022 Collabora, Ltd.
+ * Copyright © 2019, 2022, 2024 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
#include "agl-shell-server-protocol.h"
#include "agl-shell-desktop-server-protocol.h"
-static void
-create_black_curtain_view(struct ivi_output *output);
-
static uint32_t
reverse_orientation(uint32_t orientation);
/* if thew black surface view is mapped on the mean we need
* to remove it in order to start showing the 'remote' surface
* just being added */
- view = output->fullscreen_view.fs->view;
- if (view->is_mapped || view->surface->is_mapped)
- remove_black_curtain(output);
+ if (output->fullscreen_view.fs) {
+ view = output->fullscreen_view.fs->view;
+ if (view->is_mapped || view->surface->is_mapped)
+ remove_black_curtain(output);
+ }
wl_list_insert(&ivi->surfaces, &surface->link);
}
}
-
-static void
+void
create_black_curtain_view(struct ivi_output *output)
{
struct weston_surface *surface = NULL;
remove_black_curtain(struct ivi_output *output)
{
struct weston_view *view;
+ struct weston_surface *wsurface;
if ((!output &&
!output->fullscreen_view.fs &&
}
view = output->fullscreen_view.fs->view;
+ wsurface = view->surface;
assert(view->is_mapped == true ||
view->surface->is_mapped == true);
- view->is_mapped = false;
- view->surface->is_mapped = false;
-
- weston_layer_entry_remove(&view->layer_link);
- weston_view_update_transform(view);
-
- weston_view_damage_below(view);
+ weston_surface_unmap(wsurface);
+ weston_view_move_to_layer(view, NULL);
weston_log("Removed black curtain from output %s\n", output->output->name);
}
insert_black_curtain(struct ivi_output *output)
{
struct weston_view *view;
+ struct weston_surface *wsurface;
if ((!output &&
!output->fullscreen_view.fs &&
}
view = output->fullscreen_view.fs->view;
+ wsurface = view->surface;
if (view->is_mapped || view->surface->is_mapped)
return;
- weston_layer_entry_remove(&view->layer_link);
- weston_layer_entry_insert(&output->ivi->fullscreen.view_list,
- &view->layer_link);
-
- view->is_mapped = true;
- view->surface->is_mapped = true;
-
- weston_view_update_transform(view);
- weston_view_damage_below(view);
-
+ weston_surface_map(wsurface);
+ weston_view_move_to_layer(view, &output->ivi->fullscreen.view_list);
weston_log("Added black curtain to output %s\n", output->output->name);
}
struct weston_view *ev = surface->view;
struct weston_geometry geom = {};
struct ivi_output *output = NULL;
+ struct weston_coord_global pos;
int new_width, new_height;
int x, y;
ivi_shell_activate_surface(surface, ivi_seat, WESTON_ACTIVATE_FLAG_NONE);
}
- weston_view_set_position(surface->view, x, y);
+ pos.c.x = x;
+ pos.c.y = y;
+
+ weston_view_set_position(surface->view, pos);
weston_desktop_surface_set_size(surface->dsurface, new_width, new_height);
weston_desktop_surface_set_orientation(surface->dsurface, orientation);
surface->orientation = orientation;