ecore_x_window_show(bd->client.shell_win);
bd->shape = e_container_shape_add(con);
- if (e_config->focus_setting != E_FOCUS_NONE)
- bd->take_focus = 1;
+ bd->take_focus = 1;
bd->new_client = 1;
bd->changed = 1;
case RESIZE_BR:
bd->resize_mode = RESIZE_BR;
GRAV_SET(bd, ECORE_X_GRAVITY_NW);
+ break;
case RESIZE_B:
bd->resize_mode = RESIZE_B;
GRAV_SET(bd, ECORE_X_GRAVITY_N);
if ((!bd->cur_mouse_action->func.end_mouse) &&
(!bd->cur_mouse_action->func.end))
bd->cur_mouse_action = NULL;
- if (bd->cur_mouse_action)
- e_object_ref(E_OBJECT(bd->cur_mouse_action));
}
-
+ if (bd->cur_mouse_action)
+ e_object_ref(E_OBJECT(bd->cur_mouse_action));
+
return 1;
}
e_border_focus_set_with_pointer(bd);
}
}
+ else if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)
+ {
+ if ((e_config->focus_setting == E_FOCUS_NEW_DIALOG) ||
+ ((e_config->focus_setting == E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED) &&
+ (e_border_find_by_client_window(bd->client.icccm.transient_for) ==
+ e_border_focused_get())))
+ {
+ if (!bd->lock_focus_out)
+ e_border_focus_set_with_pointer(bd);
+ }
+ }
else
{
- if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)
+ /* focus window by default when it is the only one on desk */
+ E_Border *bd2 = NULL;
+ Eina_List *l;
+ EINA_LIST_FOREACH(focus_stack, l, bd2)
{
- if ((e_config->focus_setting == E_FOCUS_NEW_DIALOG) ||
- ((e_config->focus_setting == E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED) &&
- (e_border_find_by_client_window(bd->client.icccm.transient_for) ==
- e_border_focused_get())))
- {
- if (!bd->lock_focus_out)
- e_border_focus_set_with_pointer(bd);
- }
+ if (bd == bd2) continue;
+ if ((!bd2->iconic) && (bd2->visible) && (bd->desk == bd2->desk))
+ break;
}
+
+ if (!bd2)
+ e_border_focus_set_with_pointer(bd);
}
}
if (((bd->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_FULLSCREEN) &&
(!e_config->allow_manip))
-
- if (grabbed)
- e_grabinput_get(bd->win, 0, bd->win);
+ return 0;
+ if (grabbed && !e_grabinput_get(bd->win, 0, bd->win))
+ {
+ grabbed = 0;
+ return 0;
+ }
+
if (bd->client.netwm.sync.request)
{
bd->client.netwm.sync.alarm = ecore_x_sync_alarm_new(bd->client.netwm.sync.counter);
_e_border_resize_end(E_Border *bd)
{
if (grabbed)
- e_grabinput_release(bd->win, bd->win);
- grabbed = 0;
+ {
+ e_grabinput_release(bd->win, bd->win);
+ grabbed = 0;
+ }
if (bd->client.netwm.sync.alarm)
{
ecore_x_sync_alarm_free(bd->client.netwm.sync.alarm);
(!e_config->allow_manip))
return 0;
- if (grabbed)
- e_grabinput_get(bd->win, 0, bd->win);
+ if (grabbed && !e_grabinput_get(bd->win, 0, bd->win))
+ {
+ grabbed = 0;
+ return 0;
+ }
#if 0
if (bd->client.netwm.sync.request)
{
_e_border_move_end(E_Border *bd)
{
if (grabbed)
- e_grabinput_release(bd->win, bd->win);
- grabbed = 0;
+ {
+ e_grabinput_release(bd->win, bd->win);
+ grabbed = 0;
+ }
#if 0
if (bd->client.netwm.sync.alarm)
{