Add fixup for some small annoying bugs:

- bordermenu is now properly regenerated for each window
- sticky windows are now properly placed
- destroying a sticky window or a window on a desktop different than
  the current one does not produce a segmentation violation anymore
- switching desktops while moving the window moves the window to the
  new desktop
- moving focused window out of the current desktop switches the focus
  to the next available window or root window if neccessary


SVN revision: 6843
This commit is contained in:
Adam Kisiel 2003-04-09 11:39:10 +00:00
parent 3bd580b540
commit fca4d85677
4 changed files with 27 additions and 9 deletions

View File

@ -1533,7 +1533,7 @@ e_act_menu_start(E_Object * object, E_Action * a, void *data, int x, int y,
if (e_block_is_active("menus"))
D_RETURN;
b = (E_Border *) object;
b = (E_Border *) object;
if (!b)
b = e_border_current_focused();
if (!b)

View File

@ -897,7 +897,7 @@ e_cb_mouse_down(void *data, Ebits_Object o, char *class,
act = ACT_MOUSE_DOUBLE;
else if (((Ecore_Event_Mouse_Down *) (current_ev->event))->triple_click)
act = ACT_MOUSE_TRIPLE;
e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b),
NULL, x, y, border_mouse_x, border_mouse_y);
e_action_start(class, act, bt, NULL, mods, E_OBJECT(b),
@ -1407,11 +1407,14 @@ e_border_adopt(Window win, int use_client_pos)
E_Border *b;
int bw;
int show = 1;
E_Desktop *initial_desktop;
D_ENTER;
/* create the struct */
b = e_border_new();
initial_desktop = b->desk;
/* set the right event on the client */
ecore_window_set_events(win,
XEV_VISIBILITY |
@ -1546,7 +1549,7 @@ e_border_adopt(Window win, int use_client_pos)
}
else
{
show = e_place_border(b, b->desk, &x, &y,
show = e_place_border(b, initial_desktop, &x, &y,
config_data->window->place_mode);
x += pl;
y += pt;
@ -2878,7 +2881,7 @@ e_border_shuffle_last(E_Border *b)
D_RETURN_(NULL);
}
if(b)
if(b && !b->client.sticky && (b->desk == current_desk))
current = b;
else
current = evas_list_last(current_desk->windows)->data;

View File

@ -7,6 +7,7 @@
#include "bordermenu.h"
static E_Menu *bordermenu = NULL;
static E_Border *borderformenu = NULL;
static void e_bordermenu_cb_close(E_Menu * m, E_Menu_Item * mi,
void *data);
@ -346,13 +347,16 @@ e_bordermenu_cb_to_desktop(E_Menu * m, E_Menu_Item * mi, void *data)
if (b->client.sticky)
D_RETURN;
e_desktops_del_border(b->desk, b);
sscanf(mi->str, "Desktop %d", &d);
desk = e_desktops_get(d);
if (!desk)
desk = e_desktops_get(e_desktops_get_current());
D("Sending border %p to desk %d\n", b, d);
if (e_desktops_get(b->desk) == desk )
D_RETURN;
D("Sending border %p to desk %d from %d\n", b, d, b->desk);
e_desktops_del_border(b->desk, b);
e_desktops_add_border(desk, b);
b->client.desk = d;
@ -361,6 +365,8 @@ e_bordermenu_cb_to_desktop(E_Menu * m, E_Menu_Item * mi, void *data)
b->changed = 1;
e_border_update_borders();
e_border_shuffle_last(b);
D_RETURN;
UN(m);
}
@ -376,7 +382,7 @@ e_bordermenu_do(E_Border * b)
D_ENTER;
if (!bordermenu)
if (borderformenu != b)
{
menu = e_menu_new();
e_menu_set_padding_icon(menu, 2);
@ -485,6 +491,7 @@ e_bordermenu_do(E_Border * b)
e_menu_add_item(menu, menuitem);
bordermenu = menu;
borderformenu = b;
}
{
@ -520,4 +527,5 @@ e_bordermenu_hide(void)
{
if (bordermenu)
e_menu_hide(bordermenu);
borderformenu = 0;
}

View File

@ -756,7 +756,6 @@ e_desktops_goto(int d, int ax, int ay)
Evas_List *l;
E_Border *b;
if ((d == current_desk->desk.desk))
D_RETURN;
@ -774,6 +773,14 @@ e_desktops_goto(int d, int ax, int ay)
b->changed = 1;
}
}
else if ((!b->client.iconified) && (b->mode.move))
{
e_desktops_del_border(current_desk, b);
b->client.desk = desk;
e_desktops_add_border(desk, b);
b->current.requested.visible = 1;
b->changed = 1;
}
}
for (l = desk->windows; l; l = l->next)