pager - fix vanishing windows when dnd from desk to desk in pager

windows would vanish at times (eg dnd into an empty desktop in the
pager). this was pretty disconcerting and a problem, so this fixes it
with a bit of a sledgehammer, but it fixes it.

@fix
devs/devilhorns/rotation
Carsten Haitzler 4 years ago
parent 6d0ea31870
commit 6bdcf92563
  1. 37
      src/bin/e_deskmirror.c
  2. 1
      src/bin/e_deskmirror.h
  3. 5
      src/modules/pager/e_mod_main.c
  4. 5
      src/modules/pager/gadget/pager.c

@ -31,6 +31,7 @@ typedef struct E_Smart_Data
Eina_Bool taskbar E_BITFIELD;
Eina_Bool resize E_BITFIELD;
Eina_Bool force E_BITFIELD;
} E_Smart_Data;
typedef struct Mirror
@ -95,9 +96,13 @@ static void
_mirror_visible_apply(Mirror *m)
{
if (_e_deskmirror_visible_get(m->sd, m))
evas_object_show(m->mirror);
{
evas_object_show(m->mirror);
}
else
evas_object_hide(m->mirror);
{
evas_object_hide(m->mirror);
}
}
static void
@ -509,11 +514,14 @@ static void
_e_deskmirror_mirror_reconfigure(Mirror *m)
{
_e_deskmirror_mirror_geometry_get(m);
e_layout_child_move(m->mirror, m->x, m->y);
e_layout_child_resize(m->mirror, m->w, m->h);
/* assume that anything happening here is the result of a drag */
if (!e_drag_current_get())
_mirror_visible_apply(m);
if (m->mirror)
{
e_layout_child_move(m->mirror, m->x, m->y);
e_layout_child_resize(m->mirror, m->w, m->h);
/* assume that anything happening here is the result of a drag */
if (((!m->sd->force) && (!e_drag_current_get())) || (m->sd->force))
_mirror_visible_apply(m);
}
}
static void
@ -771,6 +779,7 @@ _client_desk_set(E_Smart_Data *sd, int type EINA_UNUSED, E_Event_Client_Desk_Set
/* ev->desk is previous desk */
if (!e_client_util_desk_visible(ev->ec, sd->desk))
eina_hash_del_by_key(sd->mirror_hash, &ev->ec->frame);
_mirror_visible_apply(m);
}
if ((!m) && (sd->desk == ev->ec->desk))
_e_deskmirror_mirror_add(sd, ev->ec->frame);
@ -976,3 +985,17 @@ e_deskmirror_util_wins_print(Evas_Object *obj)
fprintf(stderr, "MIRROR OBJ: %p\n", m->comp_object);
}
}
E_API void
e_deskmirror_update_force(Evas_Object *obj)
{
API_ENTRY(obj);
e_layout_freeze(sd->layout);
sd->force = EINA_TRUE;
_e_deskmirror_smart_hide(obj);
_e_deskmirror_smart_reconfigure(sd);
_e_deskmirror_smart_show(obj);
sd->force = EINA_FALSE;
e_layout_thaw(sd->layout);
}

@ -9,6 +9,7 @@ E_API void e_deskmirror_coord_canvas_to_virtual(Evas_Object *obj, Evas_Coord cx,
E_API void e_deskmirror_coord_virtual_to_canvas(Evas_Object *obj, Evas_Coord vx, Evas_Coord vy, Evas_Coord *cx, Evas_Coord *cy);
E_API E_Desk *e_deskmirror_desk_get(Evas_Object *obj);
E_API void e_deskmirror_util_wins_print(Evas_Object *obj);
E_API void e_deskmirror_update_force(Evas_Object *obj);
//#define DESKMIRROR_TEST
#endif

@ -603,6 +603,8 @@ _pager_desk_switch(Pager_Desk *pd1, Pager_Desk *pd2)
pw->client->hidden = 0;
e_client_desk_set(pw->client, desk1);
}
e_deskmirror_update_force(pd1->o_layout);
e_deskmirror_update_force(pd2->o_layout);
/* Modify desktop names in the config */
for (l = e_config->desktop_names, c = 0; l && c < 2; l = l->next)
@ -1230,6 +1232,7 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped)
/* be helpful */
if (pw->client->desk->visible && (!e_client_focused_get()))
evas_object_focus_set(pw->client->frame, 1);
e_deskmirror_update_force(pw->desk->o_layout);
}
else
{
@ -1265,6 +1268,7 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped)
if (!(ec->lock_user_stacking)) evas_object_raise(ec->frame);
evas_object_focus_set(ec->frame, 1);
e_deskmirror_update_force(pw->desk->o_layout);
}
if (p->active_drop_pd)
{
@ -1500,6 +1504,7 @@ _pager_drop_cb_drop(void *data, const char *type, void *event_info)
}
if (max) e_client_maximize(ec, max);
if (fullscreen) e_client_fullscreen(ec, fs);
e_deskmirror_update_force(pd->o_layout);
}
}

@ -782,6 +782,8 @@ _pager_desk_switch(Pager_Desk *pd1, Pager_Desk *pd2)
pw->client->hidden = 0;
e_client_desk_set(pw->client, desk1);
}
e_deskmirror_update_force(pd1->o_layout);
e_deskmirror_update_force(pd2->o_layout);
/* Modify desktop names in the config */
for (l = e_config->desktop_names, c = 0; l && c < 2; l = l->next)
@ -2136,6 +2138,7 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped)
/* be helpful */
if (pw->client->desk->visible && (!e_client_focused_get()))
evas_object_focus_set(pw->client->frame, 1);
e_deskmirror_update_force(pw->desk->o_layout);
}
else
{
@ -2171,6 +2174,7 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped)
if (!(ec->lock_user_stacking)) evas_object_raise(ec->frame);
evas_object_focus_set(ec->frame, 1);
e_deskmirror_update_force(pw->desk->o_layout);
}
edje_object_signal_emit(pw->desk->o_desk, "e,action,drag,out", "e");
if (!pw->drag.from_pager)
@ -2388,6 +2392,7 @@ _pager_drop_cb_drop(void *data, const char *type, void *event_info)
}
if (max) e_client_maximize(ec, max);
if (fullscreen) e_client_fullscreen(ec, fs);
e_deskmirror_update_force(pd->o_layout);
}
EINA_LIST_FOREACH(pd->pager->desks, l, pdd)
{

Loading…
Cancel
Save