#include "e_hwc_window_intern.h"
#include "e_canvas_intern.h"
#include "e_policy_visibility_intern.h"
+#include "e_policy_stack_intern.h"
+#include "e_policy_wl_intern.h"
+#include "e_desktop_shell_intern.h"
#define PRI(ec) ((E_Client_Private *)e_object_data_get(E_OBJECT(ec)))
EINTERN Eina_Bool
e_client_shell_configure_send(E_Client *ec, uint32_t edges, int32_t width, int32_t height)
{
+ E_Surface *surface;
+ E_Desktop_Surface *desktop_surface = NULL;
+
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- if ((!ec->comp_data->shell.surface) ||
- (!ec->comp_data->shell.configure_send))
- return EINA_FALSE;
+ surface = e_surface_try_from_ec(ec);
+ if (surface)
+ desktop_surface = e_desktop_surface_try_from_surface(surface);
+
+ if (desktop_surface)
+ {
+ e_desktop_surface_configure_send(desktop_surface, edges, width, height);
+ }
+ else
+ {
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
+
+ if ((!ec->comp_data->shell.surface) ||
+ (!ec->comp_data->shell.configure_send))
+ return EINA_FALSE;
+
+ ec->comp_data->shell.configure_send(ec->comp_data->shell.surface, edges, width, height);
+ }
- ec->comp_data->shell.configure_send(ec->comp_data->shell.surface, edges, width, height);
return EINA_TRUE;
}
EINTERN void
e_client_shell_configure(E_Client *ec, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height)
{
+ E_Surface *surface;
+ E_Desktop_Surface *desktop_surface = NULL;
+
EINA_SAFETY_ON_NULL_RETURN(ec);
- EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
- if ((!ec->comp_data->shell.surface) ||
- (!ec->comp_data->shell.configure))
- return;
+ surface = e_surface_try_from_ec(ec);
+ if (surface)
+ desktop_surface = e_desktop_surface_try_from_surface(surface);
- ec->comp_data->shell.configure(ec->comp_data->shell.surface, x, y, width, height);
+ if (desktop_surface)
+ {
+ e_desktop_surface_configure(desktop_surface, x, y, width, height);
+ }
+ else
+ {
+ EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
+
+ if ((!ec->comp_data->shell.surface) ||
+ (!ec->comp_data->shell.configure))
+ return;
+
+ ec->comp_data->shell.configure(ec->comp_data->shell.surface, x, y, width, height);
+ }
}
EINTERN void
e_client_shell_ping(E_Client *ec)
{
+ E_Surface *surface;
+ E_Desktop_Surface *desktop_surface = NULL;
+
EINA_SAFETY_ON_NULL_RETURN(ec);
- EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
- if ((!ec->comp_data->shell.surface) ||
- (!ec->comp_data->shell.ping))
- return;
+ surface = e_surface_try_from_ec(ec);
+ if (surface)
+ desktop_surface = e_desktop_surface_try_from_surface(surface);
- ec->comp_data->shell.ping(ec->comp_data->shell.surface);
+ if (desktop_surface)
+ {
+ e_desktop_surface_ping(desktop_surface);
+ }
+ else
+ {
+ EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
+
+ if ((!ec->comp_data->shell.surface) ||
+ (!ec->comp_data->shell.ping))
+ return;
+
+ ec->comp_data->shell.ping(ec->comp_data->shell.surface);
+ }
}
static void
static void
_e_client_shell_map(E_Client *ec)
{
+ E_Surface *surface;
+ E_Desktop_Surface *desktop_surface = NULL;
+
EINA_SAFETY_ON_NULL_RETURN(ec);
- EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
- if ((!ec->comp_data->shell.surface) ||
- (!ec->comp_data->shell.map))
- return;
+ surface = e_surface_try_from_ec(ec);
+ if (surface)
+ desktop_surface = e_desktop_surface_try_from_surface(surface);
- ec->comp_data->shell.map(ec->comp_data->shell.surface);
+ if (desktop_surface)
+ {
+ e_desktop_surface_map(desktop_surface);
+ }
+ else
+ {
+ EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
+
+ if ((!ec->comp_data->shell.surface) ||
+ (!ec->comp_data->shell.map))
+ return;
+
+ ec->comp_data->shell.map(ec->comp_data->shell.surface);
+ }
}
EINTERN void
e_client_shell_unmap(E_Client *ec)
{
+ E_Surface *surface;
+ E_Desktop_Surface *desktop_surface = NULL;
+
EINA_SAFETY_ON_NULL_RETURN(ec);
- EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
- if ((!ec->comp_data->shell.surface) ||
- (!ec->comp_data->shell.unmap))
- return;
+ surface = e_surface_try_from_ec(ec);
+ if (surface)
+ desktop_surface = e_desktop_surface_try_from_surface(surface);
- ec->comp_data->shell.unmap(ec->comp_data->shell.surface);
+ if (desktop_surface)
+ {
+ e_desktop_surface_unmap(desktop_surface);
+ }
+ else
+ {
+ EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
+
+ if ((!ec->comp_data->shell.surface) ||
+ (!ec->comp_data->shell.unmap))
+ return;
+
+ ec->comp_data->shell.unmap(ec->comp_data->shell.surface);
+ }
}
EINTERN void
return;
comp_wl = e_comp_wl_get();
- if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap))
+ if (ec->comp_data->shell.surface)
{
ELOGF("E_CLIENT", "Unmap", ec);
if (fullscreen_policy == E_FULLSCREEN_RESIZE)
e_client_frame_geometry_set(ec, eda->x, eda->y, eda->w, eda->h);
- if (ec->comp_data->shell.configure_send)
- _e_policy_desk_area_configure_send(ec, 0, 1);
+ _e_policy_desk_area_configure_send(ec, 0, 1);
e_client_maximize_pre_set(ec, EINA_FALSE);
}
ec->pre_res_change.valid = 0;
eda->fullscreen_clients = eina_list_remove(eda->fullscreen_clients, ec);
- if (ec->comp_data->shell.configure_send)
- _e_policy_desk_area_configure_send(ec, 0, 0);
+ _e_policy_desk_area_configure_send(ec, 0, 0);
e_client_maximize_pre_set(ec, EINA_FALSE);
// re-set maximized state for unmaximize smart callback.
ec->maximized = tmp_max;
- if (ec->comp_data && ec->comp_data->shell.configure_send)
- _e_policy_desk_area_configure_send(ec, 0, 0);
+ _e_policy_desk_area_configure_send(ec, 0, 0);
e_client_maximize_pre_set(ec, EINA_FALSE);
// un-set maximized state.
eda_client = wl_container_of(listener, eda_client, client_unmaximize_done);
ec = eda_client->ec;
- if (ec->comp_data && ec->comp_data->shell.configure_send)
- _e_policy_desk_area_configure_send(ec, 0, 0);
+ _e_policy_desk_area_configure_send(ec, 0, 0);
e_client_maximize_pre_set(ec, EINA_FALSE);
}
// "override = 1" means that ec is not controlled by wm policy
if (ec->override) return;
- if (!ec->comp_data->shell.configure_send) return;
/* TODO: calculate x, y with transfrom object */
if ((e_client_util_resizing_get(ec)) && (e_client_resize_edges_get(ec)))