_surface_init(E_Desktop_Surface *surface, E_Surface *e_surface, E_Desktop_Surface_Interface *iface)
{
surface->iface = iface;
+ surface->x = 0;
+ surface->y = 0;
+ surface->width = 0;
+ surface->height = 0;
+ surface->mapped = false;
surface->ec = e_surface_ec_get(e_surface);
assert(surface->ec);
EINTERN void
e_desktop_surface_configure(E_Desktop_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height)
{
+ if (surface->x == x && surface->y == y &&
+ surface->width == width && surface->height == height)
+ return;
+
ELOGF("SURFACE", "Configure: %d,%d %dx%d", surface->ec, x, y, width, height);
+
+ surface->x = x;
+ surface->y = y;
+ surface->width = width;
+ surface->height = height;
+
e_client_util_move_resize_without_frame(surface->ec, x, y, width, height);
}
EINTERN void
e_desktop_surface_map(E_Desktop_Surface *surface)
{
+ if (surface->mapped)
+ return;
+
ELOGF("SURFACE", "Map", surface->ec);
e_shell_e_client_map(surface->ec);
}
EINTERN void
e_desktop_surface_unmap(E_Desktop_Surface *surface)
{
+ if (!surface->mapped)
+ return;
+
ELOGF("SURFACE", "Unmap", surface->ec);
e_shell_e_client_unmap(surface->ec);
}
#ifndef E_DESKTOP_SHELL_PRIVATE_H
#define E_DESKTOP_SHELL_PRIVATE_H
+#include <stdbool.h>
+
#include "e_desktop_shell_intern.h"
typedef struct _E_Desktop_Surface_Interface E_Desktop_Surface_Interface;
E_Desktop_Surface_Interface *iface;
E_Client *ec;
+ int32_t x, y, width, height;
+
struct wl_listener surface_destroy;
+
+ bool mapped;
};
struct _E_Desktop_Toplevel