add dbus message 'org.enlightenment.wm.Window.SendToDesktop'
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
This commit is contained in:
parent
bdd290591c
commit
ec37884a31
|
@ -21,6 +21,7 @@ E_MSGBUS_WIN_ACTION_CB_PROTO(iconify);
|
|||
E_MSGBUS_WIN_ACTION_CB_PROTO(uniconify);
|
||||
E_MSGBUS_WIN_ACTION_CB_PROTO(maximize);
|
||||
E_MSGBUS_WIN_ACTION_CB_PROTO(unmaximize);
|
||||
E_MSGBUS_WIN_ACTION_CB_PROTO(sendtodesktop);
|
||||
|
||||
static const Eldbus_Method window_methods[] = {
|
||||
{ "List", NULL, ELDBUS_ARGS({"a(si)", "array_of_window"}), _e_msgbus_window_list_cb, 0 },
|
||||
|
@ -31,6 +32,7 @@ static const Eldbus_Method window_methods[] = {
|
|||
{ "Uniconify", ELDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_uniconify_cb, 0 },
|
||||
{ "Maximize", ELDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_maximize_cb, 0 },
|
||||
{ "Unmaximize", ELDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_unmaximize_cb, 0 },
|
||||
{ "SendToDesktop", ELDBUS_ARGS({"i","window_id"},{"i","zone"},{"i","desk_x"},{"i","desk_y"}), NULL, _e_msgbus_window_sendtodesktop_cb, 0 },
|
||||
{ NULL, NULL, NULL, NULL, 0}
|
||||
};
|
||||
|
||||
|
@ -117,6 +119,40 @@ E_MSGBUS_WIN_ACTION_CB_BEGIN(unmaximize)
|
|||
e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
|
||||
E_MSGBUS_WIN_ACTION_CB_END
|
||||
|
||||
static Eldbus_Message *
|
||||
_e_msgbus_window_sendtodesktop_cb( const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
|
||||
{
|
||||
E_Client *ec;
|
||||
E_Zone * zone;
|
||||
E_Desk * desk;
|
||||
Eina_List *l = NULL;
|
||||
int xwin, zonenum, xdesk, ydesk;
|
||||
|
||||
if (!eldbus_message_arguments_get(msg, "iiii", &xwin, &zonenum, &xdesk, &ydesk))
|
||||
return eldbus_message_method_return_new(msg);
|
||||
|
||||
ec = e_pixmap_find_client(E_PIXMAP_TYPE_X, xwin);
|
||||
|
||||
if (ec)
|
||||
{
|
||||
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
||||
{
|
||||
if ((int)zone->num == zonenum)
|
||||
{
|
||||
if (xdesk < zone->desk_x_count && ydesk < zone->desk_y_count)
|
||||
{
|
||||
desk = e_desk_at_xy_get(zone, xdesk, ydesk);
|
||||
if (desk) e_client_desk_set(ec, desk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return eldbus_message_method_return_new(msg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void msgbus_window_init(Eina_Array *ifaces)
|
||||
{
|
||||
Eldbus_Service_Interface *iface;
|
||||
|
|
Loading…
Reference in New Issue