From 2d971ad48c038e730b4d90cbd6ebd75367cd07d6 Mon Sep 17 00:00:00 2001 From: markt Date: Sat, 22 Jul 2006 07:15:24 +0000 Subject: ewmh compliance updates --- ChangeLog | 6 ++++++ src/Ewmh.cc | 38 +++++++++++++++++++++++++++++++++++++- src/Ewmh.hh | 3 ++- src/Screen.cc | 2 +- src/Workspace.cc | 4 ++-- src/Workspace.hh | 2 +- 6 files changed, 49 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 607c1f9..4efb323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ (Format: Year/Month/Day) Changes for 1.0rc3: +*06/07/22: + * Ewmh compliance updates: (Mark) + - implemented _NET_WM_MOVERESIZE_CANCEL (new in version 1.4.draft-1) + - move windows to last remaining workspace when a workspace is removed + - implemented _NET_REQUEST_FRAME_EXTENTS + Ewmh.cc/hh Workspace.cc/hh Screen.cc *06/07/21: * Stop using fixed values for num/caps/scroll lock, and ignore scroll lock as a modifier (Mark) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 30fee85..b6c765e 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -30,6 +30,7 @@ #include "Layer.hh" #include "WinClientUtil.hh" #include "fluxbox.hh" +#include "FbWinFrameTheme.hh" #include "FbTk/App.hh" #include "FbTk/FbWindow.hh" @@ -61,7 +62,8 @@ enum EwmhMoveResizeDirection { _NET_WM_MOVERESIZE_SIZE_LEFT = 7, _NET_WM_MOVERESIZE_MOVE = 8, // movement only _NET_WM_MOVERESIZE_SIZE_KEYBOARD = 9, // size via keyboard - _NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10 + _NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10, // move via keyboard + _NET_WM_MOVERESIZE_CANCEL = 11 // cancel operation }; Ewmh::Ewmh() { @@ -166,6 +168,7 @@ void Ewmh::initForScreen(BScreen &screen) { m_net_moveresize_window, m_net_workarea, m_net_restack_window, + m_net_request_frame_extents, m_net_wm_moveresize, @@ -311,6 +314,13 @@ void Ewmh::setupFrame(FluxboxWindow &win) { } } + /* + * NOT YET IMPLEMENTED: + * _NET_WM_WINDOW_TYPE_TOOLBAR + * _NET_WM_WINDOW_TYPE_MENU + * _NET_WM_WINDOW_TYPE_UTILITY + */ + setupState(win); if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL, @@ -872,6 +882,24 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, return true; + } else if (ce.message_type == m_net_request_frame_extents) { + if (!screen) + return true; + FbWinFrameTheme &theme = screen->winFrameTheme(); + int title_h = theme.titleHeight() || + theme.font().height() + 2*theme.bevelWidth() + 2; + title_h += theme.border().width(); + int handle_h = theme.handleWidth() + theme.border().width(); + int extents[4]; + // our frames currently don't protrude from left/right + extents[0] = 0; + extents[1] = 0; + extents[2] = title_h; + extents[3] = handle_h; + + XChangeProperty(FbTk::App::instance()->display(), ce.window, + m_net_frame_extents, XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)extents, 4); } else if (ce.message_type == m_net_wm_moveresize) { if (winclient == 0 || winclient->fbwindow() == 0) @@ -903,6 +931,12 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, case _NET_WM_MOVERESIZE_MOVE_KEYBOARD: winclient->fbwindow()->startMoving(ce.data.l[0], ce.data.l[1]); break; + case _NET_WM_MOVERESIZE_CANCEL: + if (winclient->fbwindow()->isMoving()) + winclient->fbwindow()->stopMoving(true); + if (winclient->fbwindow()->isResizing()) + winclient->fbwindow()->stopResizing(true); + break; default: cerr << "Ewmh: Unknown move/resize direction: " << ce.data.l[2] << endl; break; @@ -958,6 +992,8 @@ void Ewmh::createAtoms() { m_net_close_window = XInternAtom(disp, "_NET_CLOSE_WINDOW", False); m_net_moveresize_window = XInternAtom(disp, "_NET_MOVERESIZE_WINDOW", False); m_net_restack_window = XInternAtom(disp, "_NET_RESTACK_WINDOW", False); + m_net_request_frame_extents = XInternAtom(disp, + "_NET_REQUEST_FRAME_EXTENTS", False); m_net_wm_moveresize = XInternAtom(disp, "_NET_WM_MOVERESIZE", False); diff --git a/src/Ewmh.hh b/src/Ewmh.hh index 1643d17..b033efe 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh @@ -99,7 +99,8 @@ private: m_net_supporting_wm_check, m_net_virtual_roots, m_net_moveresize_window, - m_net_restack_window; + m_net_restack_window, + m_net_request_frame_extents; // root window messages Atom m_net_close_window, m_net_wm_moveresize; diff --git a/src/Screen.cc b/src/Screen.cc index 154dd11..8dcf528 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1031,7 +1031,7 @@ int BScreen::removeLastWorkspace() { if (m_current_workspace->workspaceID() == wkspc->workspaceID()) changeWorkspaceID(m_current_workspace->workspaceID() - 1); - wkspc->removeAll(); + wkspc->removeAll(wkspc->workspaceID()-1); //remove last workspace m_workspaces_list.pop_back(); diff --git a/src/Workspace.cc b/src/Workspace.cc index b5ffcb6..b048480 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -229,11 +229,11 @@ void Workspace::hideAll(bool interrupt_moving) { } -void Workspace::removeAll() { +void Workspace::removeAll(unsigned int dest) { Windows::iterator it = m_windowlist.begin(); Windows::const_iterator it_end = m_windowlist.end(); for (; it != it_end; ++it) - (*it)->iconify(); + m_screen.sendToWorkspace(dest, *it, false); } diff --git a/src/Workspace.hh b/src/Workspace.hh index 00c59fa..b7c2951 100644 --- a/src/Workspace.hh +++ b/src/Workspace.hh @@ -58,7 +58,7 @@ public: void showAll(); void hideAll(bool interrupt_moving); /// Iconify all windows on this workspace - void removeAll(); + void removeAll(unsigned int dest); void reconfigure(); void shutdown(); -- cgit v0.11.2