From 18ababb52d2fa5cea4df7cf66c59cbc5beadbff0 Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Fri, 3 Mar 2017 22:01:11 +0900 Subject: [PATCH] e_client: floating win's moving out of margin is limited during rotation Change-Id: I53266b9c42f21c02f9b21578226d438d7c00e1ab --- src/bin/e_client.c | 15 +++++++++++++++ src/bin/e_client.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 1e47312..0af3f9b 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -4103,6 +4103,21 @@ e_client_mouse_up(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_ } E_API void +e_client_stay_within_canvas_margin(E_Client *ec) +{ + int new_x = ec->x; + int new_y = ec->y; + + if (ec->floating) + { + _e_client_stay_within_canvas_margin(ec, ec->x, ec->y, &new_x, &new_y); + + if ((ec->x != new_x) || (ec->y != new_y)) + evas_object_move(ec->frame, new_x, new_y); + } +} + +E_API void e_client_mouse_move(E_Client *ec, Evas_Point *output) { EINA_SAFETY_ON_NULL_RETURN(ec); diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 14ad3b7..ef6bedd 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -1109,6 +1109,8 @@ E_API void e_remember_del(void *rem); /* TODO: should be removed */ E_API void e_client_visibility_force_obscured_set(E_Client *ec, Eina_Bool set); +E_API void e_client_stay_within_canvas_margin(E_Client *ec); + /** * Move window to coordinates that do not account client decorations yet. * @@ -1155,6 +1157,7 @@ e_client_util_resize_without_frame(E_Client *ec, int w, int h) if (!ec) return; e_comp_object_frame_wh_adjust(ec->frame, w, h, &w, &h); evas_object_resize(ec->frame, w, h); + e_client_stay_within_canvas_margin(ec); } /** -- 2.7.4