added support for _NET_WM_RESTACK_WINDOW.

This commit is contained in:
fluxgen 2006-04-23 21:28:09 +00:00
parent 8a68aa5328
commit 60c63e8e64
2 changed files with 41 additions and 5 deletions

View file

@ -103,6 +103,7 @@ void Ewmh::initForScreen(BScreen &screen) {
// window properties // window properties
m_net_wm_strut, m_net_wm_strut,
m_net_wm_state, m_net_wm_state,
// states that we support: // states that we support:
m_net_wm_state_sticky, m_net_wm_state_sticky,
m_net_wm_state_shaded, m_net_wm_state_shaded,
@ -143,6 +144,7 @@ void Ewmh::initForScreen(BScreen &screen) {
m_net_close_window, m_net_close_window,
m_net_moveresize_window, m_net_moveresize_window,
m_net_workarea, m_net_workarea,
m_net_restack_window,
// desktop properties // desktop properties
m_net_wm_desktop, m_net_wm_desktop,
@ -770,7 +772,30 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
winclient->fbwindow()->moveResizeForClient(ce.data.l[1], ce.data.l[2], winclient->fbwindow()->moveResizeForClient(ce.data.l[1], ce.data.l[2],
ce.data.l[3], ce.data.l[4], win_gravity); ce.data.l[3], ce.data.l[4], win_gravity);
return true; return true;
} } else if (ce.message_type == m_net_restack_window) {
#ifndef DEBUG
cerr << "Ewmh: restack window" << endl;
#endif // DEBUG
if (winclient == 0 || winclient->fbwindow() == 0)
return true;
// ce.data.l[0] = source indication
// ce.data.l[1] = sibling window
// ce.data.l[2] = detail
WinClient *above_win = Fluxbox::instance()->searchWindow(ce.data.l[1]);
if (above_win == 0 || above_win->fbwindow() == 0 ||
above_win == winclient) // this would be very wrong :)
return true;
// this might break the transient_for layering
winclient->layerItem().stackBelowItem(&winclient->layerItem(),
&above_win->layerItem());
return true;
}
// we didn't handle the ce.message_type here // we didn't handle the ce.message_type here
return false; return false;
@ -805,6 +830,7 @@ void Ewmh::createAtoms() {
m_net_close_window = XInternAtom(disp, "_NET_CLOSE_WINDOW", False); m_net_close_window = XInternAtom(disp, "_NET_CLOSE_WINDOW", False);
m_net_moveresize_window = XInternAtom(disp, "_NET_MOVERESIZE_WINDOW", False); m_net_moveresize_window = XInternAtom(disp, "_NET_MOVERESIZE_WINDOW", False);
m_net_restack_window = XInternAtom(disp, "_NET_RESTACK_WINDOW", False);
// TODO: implement this one // TODO: implement this one
m_net_wm_moveresize = XInternAtom(disp, "_NET_WM_MOVERESIZE", False); m_net_wm_moveresize = XInternAtom(disp, "_NET_WM_MOVERESIZE", False);

View file

@ -82,10 +82,20 @@ private:
void setupState(FluxboxWindow &win); void setupState(FluxboxWindow &win);
// root window properties // root window properties
Atom m_net_supported, m_net_client_list, m_net_client_list_stacking, Atom m_net_supported,
m_net_number_of_desktops, m_net_desktop_geometry, m_net_desktop_viewport, m_net_client_list,
m_net_current_desktop, m_net_desktop_names, m_net_active_window, m_net_workarea, m_net_client_list_stacking,
m_net_supporting_wm_check, m_net_virtual_roots, m_net_moveresize_window; m_net_number_of_desktops,
m_net_desktop_geometry,
m_net_desktop_viewport,
m_net_current_desktop,
m_net_desktop_names,
m_net_active_window,
m_net_workarea,
m_net_supporting_wm_check,
m_net_virtual_roots,
m_net_moveresize_window,
m_net_restack_window;
// root window messages // root window messages
Atom m_net_close_window, m_net_wm_moveresize; Atom m_net_close_window, m_net_wm_moveresize;