summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-11-07 13:52:31 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-11-07 13:53:27 +0900
commit6a47c2243e604e44461ae915476f50d00eeafdf6 (patch)
treea84f58e62727f65c9a24971107425349641f7191 /src/lib/elementary
parentee93543799fc4ccf72a0cbf43a2c3efe5c61d6d3 (diff)
efl ui win - make win centering work with multiple screens
this should fix T6323 @fix
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_win.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 4904a13e10..87e7e9624d 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -5595,6 +5595,52 @@ _efl_ui_win_center(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool h, Eina_Bool v)
5595 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj, h, v))) 5595 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj, h, v)))
5596 return; 5596 return;
5597 5597
5598 if (!efl_gfx_visible_get(obj))
5599 {
5600 // Chose to use env var so this will also translate more easily
5601 // to wayland. yes - we can get x atoms to figure out if wm is
5602 // enlightenment, but this works just as well. for wl we'd need
5603 // an alternate wl specific way... this below works better IMHO
5604 const char *s = getenv("DESKTOP");
5605
5606 if ((s) && (!strcasecmp(s, "Enlightenment")))
5607 {
5608#ifdef HAVE_ELEMENTARY_X
5609 if (sd->x.xwin)
5610 {
5611 static Ecore_X_Atom state = 0;
5612 static Ecore_X_Atom centered = 0;
5613
5614 if (!centered) centered = ecore_x_atom_get
5615 ("__E_ATOM_WINDOW_STATE_CENTERED");
5616 if (!state) state = ecore_x_atom_get
5617 ("__E_ATOM_WINDOW_STATE");
5618 ecore_x_window_prop_card32_set(sd->x.xwin, state, &centered, 1);
5619 }
5620#endif
5621// XXX: what to do with wayland?
5622 return;
5623 }
5624 // not e - fall back to manually placing on what we think the screen
5625 // is/will be... to do this move window to where pointer is first
5626#ifdef HAVE_ELEMENTARY_X
5627 if (sd->x.xwin)
5628 {
5629 int x = 0, y = 0;
5630
5631 if (sd->req_wh)
5632 {
5633 win_w = sd->req_w;
5634 win_h = sd->req_h;
5635 }
5636 else evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
5637 ecore_x_pointer_root_xy_get(&x, &y);
5638 ecore_evas_move(sd->ee, x - (win_w / 2), y - (win_h / 2));
5639 }
5640#endif
5641// XXX: what to do with wayland?
5642 }
5643
5598 ecore_evas_screen_geometry_get(sd->ee, 5644 ecore_evas_screen_geometry_get(sd->ee,
5599 &screen_x, &screen_y, 5645 &screen_x, &screen_y,
5600 &screen_w, &screen_h); 5646 &screen_w, &screen_h);