client_iconify(client, TRUE, TRUE);
frame_adjust_focus(client->frame, FALSE);
break;
- case EnterNotify:
+ case LeaveNotify:
+ con = frame_context(client, e->xcrossing.window);
switch (con) {
case OB_FRAME_CONTEXT_MAXIMIZE:
+ client->frame->max_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_ALLDESKTOPS:
+ client->frame->desk_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_SHADE:
+ client->frame->shade_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_ICONIFY:
+ client->frame->iconify_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_CLOSE:
- g_message("hi");
+ client->frame->close_hover = FALSE;
frame_adjust_state(client->frame);
break;
default:
break;
}
- con = frame_context(client, e->xcrossing.subwindow);
- if (client_normal(client)) {
- if (ob_state() == OB_STATE_STARTING) {
- /* move it to the top of the focus order */
- guint desktop = client->desktop;
- if (desktop == DESKTOP_ALL) desktop = screen_desktop;
- focus_order[desktop] = g_list_remove(focus_order[desktop],
- client);
- focus_order[desktop] = g_list_prepend(focus_order[desktop],
- client);
- } else if (config_focus_follow) {
+ break;
+ case EnterNotify:
+ con = frame_context(client, e->xcrossing.window);
+ switch (con) {
+ case OB_FRAME_CONTEXT_MAXIMIZE:
+ client->frame->max_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_ALLDESKTOPS:
+ client->frame->desk_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_SHADE:
+ client->frame->shade_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_ICONIFY:
+ client->frame->iconify_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_CLOSE:
+ client->frame->close_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_FRAME:
+ if (client_normal(client)) {
+ if (ob_state() == OB_STATE_STARTING) {
+ /* move it to the top of the focus order */
+ guint desktop = client->desktop;
+ if (desktop == DESKTOP_ALL) desktop = screen_desktop;
+ focus_order[desktop] = g_list_remove(focus_order[desktop],
+ client);
+ focus_order[desktop] = g_list_prepend(focus_order[desktop],
+ client);
+ } else if (config_focus_follow) {
#ifdef DEBUG_FOCUS
- ob_debug("EnterNotify on %lx, focusing window\n",
- client->window);
+ ob_debug("EnterNotify on %lx, focusing window\n",
+ client->window);
#endif
- client_focus(client);
+ client_focus(client);
+ }
}
+ break;
+ default:
+ break;
}
break;
case ConfigureRequest:
#define FRAME_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
ButtonPressMask | ButtonReleaseMask)
#define ELEMENT_EVENTMASK (ButtonPressMask | ButtonReleaseMask | \
- ButtonMotionMask | ExposureMask)
+ ButtonMotionMask | ExposureMask | \
+ EnterWindowMask | LeaveWindowMask)
#define FRAME_HANDLE_Y(f) (f->innersize.top + f->client->area.height + \
f->cbwidth)
self->max_press = self->close_press = self->desk_press =
self->iconify_press = self->shade_press = FALSE;
+ self->max_hover = self->close_hover = self->desk_hover =
+ self->iconify_hover = self->shade_hover = FALSE;
return (ObFrame*)self;
}
gboolean desk_press;
gboolean shade_press;
gboolean iconify_press;
+ gboolean max_hover;
+ gboolean close_hover;
+ gboolean desk_hover;
+ gboolean shade_hover;
+ gboolean iconify_hover;
gboolean focused;
};
ob_rr_theme->a_focused_pressed_set_max :
(self->max_press ?
ob_rr_theme->a_focused_pressed_max :
- ob_rr_theme->a_focused_unpressed_max)) :
+ (self->max_hover ?
+ ob_rr_theme->a_hover_focused_max :
+ ob_rr_theme->a_focused_unpressed_max))) :
(self->client->max_vert || self->client->max_horz ?
ob_rr_theme->a_unfocused_pressed_set_max :
(self->max_press ?
ob_rr_theme->a_unfocused_pressed_max :
- ob_rr_theme->a_unfocused_unpressed_max))));
+ (self->max_hover ?
+ ob_rr_theme->a_hover_unfocused_max :
+ ob_rr_theme->a_unfocused_unpressed_max)))));
n = self->a_icon;
i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ?
(self->focused ?
(self->focused ?
(self->iconify_press ?
ob_rr_theme->a_focused_pressed_iconify :
- ob_rr_theme->a_focused_unpressed_iconify) :
+ (self->iconify_hover ?
+ ob_rr_theme->a_hover_focused_iconify :
+ ob_rr_theme->a_focused_unpressed_iconify)) :
(self->iconify_press ?
ob_rr_theme->a_unfocused_pressed_iconify :
- ob_rr_theme->a_unfocused_unpressed_iconify)));
+ (self->iconify_hover ?
+ ob_rr_theme->a_hover_unfocused_iconify :
+ ob_rr_theme->a_unfocused_unpressed_iconify))));
d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ?
(self->focused ?
ob_rr_theme->a_disabled_focused_desk :
ob_rr_theme->a_focused_pressed_set_desk :
(self->desk_press ?
ob_rr_theme->a_focused_pressed_desk :
- ob_rr_theme->a_focused_unpressed_desk)) :
+ (self->desk_hover ?
+ ob_rr_theme->a_hover_focused_desk :
+ ob_rr_theme->a_focused_unpressed_desk))) :
(self->client->desktop == DESKTOP_ALL ?
ob_rr_theme->a_unfocused_pressed_set_desk :
(self->desk_press ?
ob_rr_theme->a_unfocused_pressed_desk :
- ob_rr_theme->a_unfocused_unpressed_desk))));
+ (self->desk_hover ?
+ ob_rr_theme->a_hover_unfocused_desk :
+ ob_rr_theme->a_unfocused_unpressed_desk)))));
s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ?
(self->focused ?
ob_rr_theme->a_disabled_focused_shade :
ob_rr_theme->a_focused_pressed_set_shade :
(self->shade_press ?
ob_rr_theme->a_focused_pressed_shade :
- ob_rr_theme->a_focused_unpressed_shade)) :
+ (self->shade_hover ?
+ ob_rr_theme->a_hover_focused_shade :
+ ob_rr_theme->a_focused_unpressed_shade))) :
(self->client->shaded ?
ob_rr_theme->a_unfocused_pressed_set_shade :
(self->shade_press ?
ob_rr_theme->a_unfocused_pressed_shade :
- ob_rr_theme->a_unfocused_unpressed_shade))));
+ (self->shade_hover ?
+ ob_rr_theme->a_hover_unfocused_shade :
+ ob_rr_theme->a_unfocused_unpressed_shade)))));
c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ?
(self->focused ?
ob_rr_theme->a_disabled_focused_close :
(self->focused ?
(self->close_press ?
ob_rr_theme->a_focused_pressed_close :
- ob_rr_theme->a_focused_unpressed_close) :
+ (self->close_hover ?
+ ob_rr_theme->a_hover_focused_close :
+ ob_rr_theme->a_focused_unpressed_close)) :
(self->close_press ?
ob_rr_theme->a_unfocused_pressed_close :
- ob_rr_theme->a_unfocused_unpressed_close)));
+ (self->close_hover ?
+ ob_rr_theme->a_hover_unfocused_close :
+ ob_rr_theme->a_unfocused_unpressed_close))));
RrPaint(t, self->title, self->width, ob_rr_theme->title_height);