aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-10-29 08:39:40 -0200
committerRafael Antognolli <rafael.antognolli@intel.com>2013-10-29 09:20:48 -0200
commite8a029b1532e9f8f26f06a3d30b4ee3f1dbb963d (patch)
tree3d44e90ed5b861660c9f9ca3a0ff6ee7f97f8138 /legacy/elementary/src/lib/elm_win.c
parentelm/win: Put framespace set code in a common place. (diff)
downloadefl-e8a029b1532e9f8f26f06a3d30b4ee3f1dbb963d.tar.gz
elm/win: Do not force maximized status.
When receiving a maximize event from the maximize button, do not force sd->maximized. We must wait for a state change event, just like when a window is maximized by the elm_win_maximized_set function. This will ensure that a maximized smart event is sent. Additionally, send a elm,state,maximized signal to the edje theme, so it can update shadows and window decorations correctly.
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index fa41545d65..19f9cbc0c7 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -2368,17 +2368,38 @@ _elm_win_frame_cb_minimize(void *data,
}
static void
+_elm_win_frame_maximized_state_update(Elm_Win_Smart_Data *sd, Eina_Bool maximized)
+{
+ const char *emission;
+
+ if (maximized)
+ emission = "elm,state,maximized";
+ else
+ emission = "elm,state,unmaximized";
+
+ edje_object_signal_emit(sd->frame_obj, emission, "elm");
+ edje_object_message_signal_process(sd->frame_obj);
+ evas_object_smart_calculate(sd->frame_obj);
+
+ _elm_win_frame_obj_update(sd);
+}
+
+static void
_elm_win_frame_cb_maximize(void *data,
Evas_Object *obj __UNUSED__,
const char *sig __UNUSED__,
const char *source __UNUSED__)
{
+ Eina_Bool value;
ELM_WIN_DATA_GET(data, sd);
if (!sd) return;
- if (sd->maximized) sd->maximized = EINA_FALSE;
- else sd->maximized = EINA_TRUE;
- TRAP(sd, maximized_set, sd->maximized);
+ if (sd->maximized) value = EINA_FALSE;
+ else value = EINA_TRUE;
+
+ _elm_win_frame_maximized_state_update(sd, value);
+
+ TRAP(sd, maximized_set, value);
}
static void
@@ -3835,7 +3856,7 @@ _maximized_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
Eina_Bool maximized = va_arg(*list, int);
Elm_Win_Smart_Data *sd = _pd;
-// sd->maximized = maximized;
+ _elm_win_frame_maximized_state_update(sd, maximized);
// YYY: handle if sd->img_obj
TRAP(sd, maximized_set, maximized);
#ifdef HAVE_ELEMENTARY_X