aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-10-28 16:48:56 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-11-23 13:04:12 +0900
commit4722b685cfb9343ffb240e6655c60cf2af8fcb54 (patch)
tree0b3d61f4726e1c4b76339c70ba1c29488ef73d15 /src/lib/elementary
parentwin: Make X windows border when using CSD mode (diff)
downloadefl-4722b685cfb9343ffb240e6655c60cf2af8fcb54.tar.gz
ecore_evas/x: Inform WM about borders and shadows
This exploits the existing X Atom "GTK_FRAME_EXTENTS"
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_win.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index fd2752fa56..e3782eb3a0 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1370,6 +1370,7 @@ _elm_win_opaque_update(Efl_Ui_Win_Data *sd)
else
ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, 0, 0);
+ /* FIXME: Replace with call to ecore_evas_shadow_geometry_set(). */
ecore_wl2_window_geometry_set(sd->wl.win, ox, oy, ow, oh);
ecore_wl2_window_input_region_set(sd->wl.win, ox, oy, ow, oh);
}
@@ -2863,6 +2864,25 @@ super_skip:
efl_gfx_position_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), x, y);
}
+static inline void
+_elm_win_frame_geometry_adjust(Efl_Ui_Win_Data *sd)
+{
+ int l = 0, t = 0, r = 0, b = 0;
+
+ if (sd->frame_obj)
+ {
+ int fw, fh, ox, oy, ow, oh;
+ evas_object_geometry_get(sd->frame_obj, NULL, NULL, &fw, &fh);
+ edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
+ &ox, &oy, &ow, &oh);
+ l = ox;
+ t = oy;
+ r = fw - ow - l;
+ b = fh - oh - t;
+ }
+ ecore_evas_shadow_geometry_set(sd->ee, l, r, t, b);
+}
+
EOLIAN static void
_efl_ui_win_efl_gfx_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Coord w, Evas_Coord h)
{
@@ -2885,6 +2905,7 @@ _efl_ui_win_efl_gfx_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Coord w, Evas_Co
evas_object_image_size_set(sd->img_obj, w, h);
}
+ _elm_win_frame_geometry_adjust(sd);
if (!sd->response) TRAP(sd, resize, w, h);
efl_gfx_size_set(efl_super(obj, MY_CLASS), w, h);
@@ -3292,6 +3313,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj)
if (sd->img_obj) evas_object_resize(obj, w, h);
else
{
+ _elm_win_frame_geometry_adjust(sd);
if (!sd->response) TRAP(sd, resize, w, h);
}
}
@@ -4023,6 +4045,7 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *style)
if (ecore_evas_maximized_get(sd->ee))
edje_object_signal_emit(sd->frame_obj, "elm,state,maximize", "elm");
+ _elm_win_frame_geometry_adjust(sd);
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
ecore_evas_resize(sd->ee, w, h);
}
@@ -4070,6 +4093,7 @@ _elm_win_frame_del(Efl_Ui_Win_Data *sd)
if (sd->icon) evas_object_hide(sd->icon);
evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
+ _elm_win_frame_geometry_adjust(sd);
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
ecore_evas_resize(sd->ee, w, h);
#ifdef HAVE_ELEMENTARY_WL2