forked from e16/e16
1
0
Fork 0

Initial urgency and DEMANDS_ATTENTION support.

SVN revision: 15069
This commit is contained in:
Kim Woelders 2005-06-02 22:11:09 +00:00
parent 2cf095e2f5
commit cba1815b95
5 changed files with 51 additions and 66 deletions

View File

@ -656,10 +656,11 @@ typedef struct _winclient
Colormap cmap;
Window icon_win;
Pixmap icon_pmap, icon_mask;
char start_iconified;
Window group;
Window client_leader;
char start_iconified;
char need_input;
char urgency;
char take_focus;
char delete_window;
signed char transient;
@ -766,6 +767,7 @@ struct _ewin
unsigned maximized_vert:1;
unsigned fullscreen:1;
unsigned showingdesk:1; /* Iconified by show desktop */
unsigned attention:1;
} st;
struct
{
@ -1576,6 +1578,7 @@ void EventShow(const XEvent * ev);
#define EWIN_CHANGE_DESKTOP (1<<3)
#define EWIN_CHANGE_LAYER (1<<4)
#define EWIN_CHANGE_OPACITY (1<<5)
#define EWIN_CHANGE_ATTENTION (1<<6)
void EwinShapeSet(EWin * ewin);
void EwinFloatAt(EWin * ewin, int x, int y);

View File

@ -1606,6 +1606,11 @@ EwinChangesProcess(EWin * ewin)
SnapshotEwinUpdate(ewin, SNAP_USE_OPACITY);
}
if (EWinChanges.flags & EWIN_CHANGE_ATTENTION)
{
HintsSetWindowState(ewin);
}
EWinChanges.flags = 0;
}

View File

@ -142,9 +142,7 @@ EWMH_Init(Window win_wm_check)
atom_list[atom_count++] = ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN;
atom_list[atom_count++] = ECORE_X_ATOM_NET_WM_STATE_ABOVE;
atom_list[atom_count++] = ECORE_X_ATOM_NET_WM_STATE_BELOW;
#if 0
atom_list[atom_count++] = ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION;
#endif
atom_list[atom_count++] = ECORE_X_ATOM_NET_WM_STRUT;
atom_list[atom_count++] = ECORE_X_ATOM_NET_FRAME_EXTENTS;
@ -383,10 +381,10 @@ EWMH_SetWindowState(const EWin * ewin)
EoGetLayer(ewin) >= 6);
atom_list_set(atom_list, len, &atom_count, ECORE_X_ATOM_NET_WM_STATE_BELOW,
EoGetLayer(ewin) <= 2);
#if 0
atom_list_set(atom_list, len, &atom_count,
ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION, TBD);
#endif
ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION,
ewin->st.attention);
ecore_x_window_prop_atom_set(ewin->client.win, ECORE_X_ATOM_NET_WM_STATE,
atom_list, atom_count);
}
@ -494,7 +492,7 @@ EWMH_GetWindowState(EWin * ewin)
ewin->shaded = 0;
ewin->skiptask = ewin->skip_ext_pager = 0;
ewin->st.maximized_horz = ewin->st.maximized_vert = 0;
ewin->st.fullscreen = 0;
ewin->st.fullscreen = ewin->st.attention = 0;
/* ewin->layer = No ... TBD */
for (i = 0; i < n_atoms; i++)
@ -520,10 +518,8 @@ EWMH_GetWindowState(EWin * ewin)
EoSetLayer(ewin, 6);
else if (atom == ECORE_X_ATOM_NET_WM_STATE_BELOW)
EoSetLayer(ewin, 2);
#if 0
else if (atom == ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION)
TBD;
#endif
ewin->st.attention = 1;
}
Efree(p_atoms);
}
@ -817,13 +813,13 @@ EWMH_ProcessClientMessage(XClientMessageEvent * ev)
{
action = do_set(ewin->skiptask, action);
ewin->skiptask = action;
/* Set ECORE_X_ATOM_NET_WM_STATE ? */
EWMH_SetWindowState(ewin);
}
else if (atom == ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER)
{
action = do_set(ewin->skip_ext_pager, action);
ewin->skip_ext_pager = action;
/* Set ECORE_X_ATOM_NET_WM_STATE ? */
EWMH_SetWindowState(ewin);
}
else if (atom == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT ||
atom == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
@ -889,11 +885,12 @@ EWMH_ProcessClientMessage(XClientMessageEvent * ev)
else
EwinOpSetLayer(ewin, 4);
}
#if 0
else if (atom == ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION)
{
action = do_set(ewin->st.attention, action);
ewin->st.attention = action;
EWMH_SetWindowState(ewin);
}
#endif
}
else if (ev->message_type == ECORE_X_ATOM_NET_WM_MOVERESIZE)
{

View File

@ -223,6 +223,12 @@ FocusEwinSetActive(EWin * ewin, int active)
EwinBorderUpdateState(ewin);
FocusEwinSetGrabs(ewin);
if (active && ewin->st.attention)
{
ewin->st.attention = 0;
HintsSetWindowState(ewin);
}
}
void

View File

@ -632,73 +632,47 @@ ICCCM_GetHints(EWin * ewin, Atom atom_change)
}
}
if (hint->flags & InputHint)
{
if (hint->input)
{
ewin->client.need_input = 1;
}
else
{
ewin->client.need_input = 0;
}
}
else
{
ewin->client.need_input = 1;
}
ewin->client.need_input =
((hint->flags & InputHint) && (!hint->input)) ? 0 : 1;
if (hint->flags & StateHint)
{
if (hint->initial_state == IconicState)
{
ewin->client.start_iconified = 1;
}
else
{
ewin->client.start_iconified = 0;
}
}
else
{
ewin->client.start_iconified = 0;
}
ewin->client.start_iconified =
((hint->flags & StateHint) &&
(hint->initial_state == IconicState)) ? 1 : 0;
if (hint->flags & IconPixmapHint)
{
ewin->client.icon_pmap = hint->icon_pixmap;
EwinChange(ewin, EWIN_CHANGE_ICON_PMAP);
if (ewin->client.icon_pmap != hint->icon_pixmap)
{
ewin->client.icon_pmap = hint->icon_pixmap;
EwinChange(ewin, EWIN_CHANGE_ICON_PMAP);
}
}
else
{
ewin->client.icon_pmap = 0;
ewin->client.icon_pmap = None;
}
if (hint->flags & IconMaskHint)
{
ewin->client.icon_mask = hint->icon_mask;
}
else
{
ewin->client.icon_mask = 0;
}
ewin->client.icon_mask =
(hint->flags & IconMaskHint) ? hint->icon_mask : None;
if (hint->flags & IconWindowHint)
{
ewin->client.icon_win = hint->icon_window;
}
else
{
ewin->client.icon_win = 0;
}
ewin->client.icon_win =
(hint->flags & IconWindowHint) ? hint->icon_window : None;
if (hint->flags & WindowGroupHint)
ewin->client.group =
(hint->flags & WindowGroupHint) ? hint->window_group : None;
if (hint->flags & XUrgencyHint)
{
ewin->client.group = hint->window_group;
if (!ewin->client.urgency)
{
ewin->client.urgency = 1;
EwinChange(ewin, EWIN_CHANGE_ATTENTION);
}
ewin->st.attention = 1;
}
else
{
ewin->client.group = 0;
ewin->client.urgency = 0;
}
XFree(hint);