From f8ba5dcd1b4b882e0dd0663b677572398e80dfe3 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Thu, 14 Nov 2013 11:34:53 -0200 Subject: [PATCH] Fixes to work with EFL 1.7 NOTE: elm_popup is broken on the second screen (another window), this leads to help or screenshot on the second screen to be broken with 1.7, at least on my setup it will hide itself but won't show the dialog (elm_popup), thus will stop responding (however you can work on the other screen and even exit the application by clicking "Exit"). --- src/bin/main.c | 29 +++++++++++++++++++++++++++++ src/bin/platform-x.c | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/bin/main.c b/src/bin/main.c index 1d88ff8..d79e45a 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -1413,8 +1413,14 @@ show_gui_help(Zone *zone) help = elm_entry_add(popup); elm_entry_editable_set(help, EINA_FALSE); + +#if (ELM_VERSION_MAJOR >= 1) && (ELM_VERSION_MINOR >= 8) elm_scroller_policy_set(help, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); +#else + elm_entry_scrollbar_policy_set(help, ELM_SCROLLER_POLICY_OFF, + ELM_SCROLLER_POLICY_AUTO); +#endif elm_object_text_set (help, @@ -1623,7 +1629,14 @@ _create_screenshot_select_cb(void *data, Evas_Object *btn EINA_UNUSED, void *eve /* stack + sizer to make popup bigger */ sizer = evas_object_rectangle_add(zone->evas); +#if (ELM_VERSION_MAJOR >= 1) && (ELM_VERSION_MINOR >= 8) evas_object_size_hint_min_set(sizer, zone->w * 0.5, zone->h * 0.5); +#else + /* 1.7 popup theme is badly written and won't adapt base to contents, + * instead the contents is "limited" to 400px in width. So use this :-( + */ + evas_object_size_hint_min_set(sizer, 400, (zone->h * 400.0) / zone->w); +#endif evas_object_color_set(sizer, 0, 0, 0, 0); evas_object_show(sizer); elm_box_pack_end(bx, sizer); @@ -1686,7 +1699,11 @@ _create_screenshot_notify_show(Zone *zone, double timeout, const char *msg) notify = elm_notify_add(zone->win); elm_notify_allow_events_set(notify, EINA_FALSE); +#if (ELM_VERSION_MAJOR >= 1) && (ELM_VERSION_MINOR >= 8) elm_notify_align_set(notify, 0.5, 0.5); +#else + elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_CENTER); +#endif if (timeout > 0.0) elm_notify_timeout_set(notify, timeout); @@ -1911,7 +1928,14 @@ _create_screenshot_copy_cb(void *data, Eina_Bool success) zone->screenshot.preview = img = evas_object_image_filled_add(zone->evas); evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(img, EVAS_HINT_FILL, EVAS_HINT_FILL); +#if (ELM_VERSION_MAJOR >= 1) && (ELM_VERSION_MINOR >= 8) evas_object_size_hint_min_set(img, zone->w * 0.5, zone->h * 0.5); +#else + /* 1.7 popup theme is badly written and won't adapt base to contents, + * instead the contents is "limited" to 400px in width. So use this :-( + */ + evas_object_size_hint_min_set(img, 400, (zone->h * 400.0) / zone->w); +#endif ecore_evas_geometry_get(zone->screenshot.ee, NULL, NULL, &iw, &ih); pixels = ecore_evas_buffer_pixels_get(zone->screenshot.ee); @@ -2584,8 +2608,13 @@ show_gui_error(const char *message) help = elm_entry_add(bx); elm_entry_editable_set(help, EINA_FALSE); +#if (ELM_VERSION_MAJOR >= 1) && (ELM_VERSION_MINOR >= 8) elm_scroller_policy_set(help, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); +#else + elm_entry_scrollbar_policy_set(help, ELM_SCROLLER_POLICY_OFF, + ELM_SCROLLER_POLICY_AUTO); +#endif evas_object_size_hint_weight_set(help, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(help, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(help, message); diff --git a/src/bin/platform-x.c b/src/bin/platform-x.c index 1dabd05..f302f51 100644 --- a/src/bin/platform-x.c +++ b/src/bin/platform-x.c @@ -163,7 +163,7 @@ _x_grab_current(void) const Zone *zone; int mx, my; - ecore_x_pointer_root_xy_get(&mx, &my); + ecore_x_pointer_xy_get(ecore_x_window_root_first_get(), &mx, &my); EINA_LIST_FOREACH(zones, l, zone) {