summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2006-07-22 07:15:24 (GMT)
committermarkt <markt>2006-07-22 07:15:24 (GMT)
commit2d971ad48c038e730b4d90cbd6ebd75367cd07d6 (patch)
tree5e356eaa9a394e4ad65185795fb4ba48ac24b21e /src
parenta72fc5e00213eccb1fcf019566eea7c98fdb0611 (diff)
downloadfluxbox_lack-2d971ad48c038e730b4d90cbd6ebd75367cd07d6.zip
fluxbox_lack-2d971ad48c038e730b4d90cbd6ebd75367cd07d6.tar.bz2
ewmh compliance updates
Diffstat (limited to 'src')
-rw-r--r--src/Ewmh.cc38
-rw-r--r--src/Ewmh.hh3
-rw-r--r--src/Screen.cc2
-rw-r--r--src/Workspace.cc4
-rw-r--r--src/Workspace.hh2
5 files changed, 43 insertions, 6 deletions
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 @@
30#include "Layer.hh" 30#include "Layer.hh"
31#include "WinClientUtil.hh" 31#include "WinClientUtil.hh"
32#include "fluxbox.hh" 32#include "fluxbox.hh"
33#include "FbWinFrameTheme.hh"
33 34
34#include "FbTk/App.hh" 35#include "FbTk/App.hh"
35#include "FbTk/FbWindow.hh" 36#include "FbTk/FbWindow.hh"
@@ -61,7 +62,8 @@ enum EwmhMoveResizeDirection {
61 _NET_WM_MOVERESIZE_SIZE_LEFT = 7, 62 _NET_WM_MOVERESIZE_SIZE_LEFT = 7,
62 _NET_WM_MOVERESIZE_MOVE = 8, // movement only 63 _NET_WM_MOVERESIZE_MOVE = 8, // movement only
63 _NET_WM_MOVERESIZE_SIZE_KEYBOARD = 9, // size via keyboard 64 _NET_WM_MOVERESIZE_SIZE_KEYBOARD = 9, // size via keyboard
64 _NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10 65 _NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10, // move via keyboard
66 _NET_WM_MOVERESIZE_CANCEL = 11 // cancel operation
65}; 67};
66 68
67Ewmh::Ewmh() { 69Ewmh::Ewmh() {
@@ -166,6 +168,7 @@ void Ewmh::initForScreen(BScreen &screen) {
166 m_net_moveresize_window, 168 m_net_moveresize_window,
167 m_net_workarea, 169 m_net_workarea,
168 m_net_restack_window, 170 m_net_restack_window,
171 m_net_request_frame_extents,
169 172
170 m_net_wm_moveresize, 173 m_net_wm_moveresize,
171 174
@@ -311,6 +314,13 @@ void Ewmh::setupFrame(FluxboxWindow &win) {
311 } 314 }
312 } 315 }
313 316
317 /*
318 * NOT YET IMPLEMENTED:
319 * _NET_WM_WINDOW_TYPE_TOOLBAR
320 * _NET_WM_WINDOW_TYPE_MENU
321 * _NET_WM_WINDOW_TYPE_UTILITY
322 */
323
314 setupState(win); 324 setupState(win);
315 325
316 if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL, 326 if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL,
@@ -872,6 +882,24 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
872 882
873 883
874 return true; 884 return true;
885 } else if (ce.message_type == m_net_request_frame_extents) {
886 if (!screen)
887 return true;
888 FbWinFrameTheme &theme = screen->winFrameTheme();
889 int title_h = theme.titleHeight() ||
890 theme.font().height() + 2*theme.bevelWidth() + 2;
891 title_h += theme.border().width();
892 int handle_h = theme.handleWidth() + theme.border().width();
893 int extents[4];
894 // our frames currently don't protrude from left/right
895 extents[0] = 0;
896 extents[1] = 0;
897 extents[2] = title_h;
898 extents[3] = handle_h;
899
900 XChangeProperty(FbTk::App::instance()->display(), ce.window,
901 m_net_frame_extents, XA_CARDINAL, 32, PropModeReplace,
902 (unsigned char *)extents, 4);
875 903
876 } else if (ce.message_type == m_net_wm_moveresize) { 904 } else if (ce.message_type == m_net_wm_moveresize) {
877 if (winclient == 0 || winclient->fbwindow() == 0) 905 if (winclient == 0 || winclient->fbwindow() == 0)
@@ -903,6 +931,12 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
903 case _NET_WM_MOVERESIZE_MOVE_KEYBOARD: 931 case _NET_WM_MOVERESIZE_MOVE_KEYBOARD:
904 winclient->fbwindow()->startMoving(ce.data.l[0], ce.data.l[1]); 932 winclient->fbwindow()->startMoving(ce.data.l[0], ce.data.l[1]);
905 break; 933 break;
934 case _NET_WM_MOVERESIZE_CANCEL:
935 if (winclient->fbwindow()->isMoving())
936 winclient->fbwindow()->stopMoving(true);
937 if (winclient->fbwindow()->isResizing())
938 winclient->fbwindow()->stopResizing(true);
939 break;
906 default: 940 default:
907 cerr << "Ewmh: Unknown move/resize direction: " << ce.data.l[2] << endl; 941 cerr << "Ewmh: Unknown move/resize direction: " << ce.data.l[2] << endl;
908 break; 942 break;
@@ -958,6 +992,8 @@ void Ewmh::createAtoms() {
958 m_net_close_window = XInternAtom(disp, "_NET_CLOSE_WINDOW", False); 992 m_net_close_window = XInternAtom(disp, "_NET_CLOSE_WINDOW", False);
959 m_net_moveresize_window = XInternAtom(disp, "_NET_MOVERESIZE_WINDOW", False); 993 m_net_moveresize_window = XInternAtom(disp, "_NET_MOVERESIZE_WINDOW", False);
960 m_net_restack_window = XInternAtom(disp, "_NET_RESTACK_WINDOW", False); 994 m_net_restack_window = XInternAtom(disp, "_NET_RESTACK_WINDOW", False);
995 m_net_request_frame_extents = XInternAtom(disp,
996 "_NET_REQUEST_FRAME_EXTENTS", False);
961 997
962 998
963 m_net_wm_moveresize = XInternAtom(disp, "_NET_WM_MOVERESIZE", False); 999 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:
99 m_net_supporting_wm_check, 99 m_net_supporting_wm_check,
100 m_net_virtual_roots, 100 m_net_virtual_roots,
101 m_net_moveresize_window, 101 m_net_moveresize_window,
102 m_net_restack_window; 102 m_net_restack_window,
103 m_net_request_frame_extents;
103 104
104 // root window messages 105 // root window messages
105 Atom m_net_close_window, m_net_wm_moveresize; 106 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() {
1031 if (m_current_workspace->workspaceID() == wkspc->workspaceID()) 1031 if (m_current_workspace->workspaceID() == wkspc->workspaceID())
1032 changeWorkspaceID(m_current_workspace->workspaceID() - 1); 1032 changeWorkspaceID(m_current_workspace->workspaceID() - 1);
1033 1033
1034 wkspc->removeAll(); 1034 wkspc->removeAll(wkspc->workspaceID()-1);
1035 1035
1036 //remove last workspace 1036 //remove last workspace
1037 m_workspaces_list.pop_back(); 1037 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) {
229} 229}
230 230
231 231
232void Workspace::removeAll() { 232void Workspace::removeAll(unsigned int dest) {
233 Windows::iterator it = m_windowlist.begin(); 233 Windows::iterator it = m_windowlist.begin();
234 Windows::const_iterator it_end = m_windowlist.end(); 234 Windows::const_iterator it_end = m_windowlist.end();
235 for (; it != it_end; ++it) 235 for (; it != it_end; ++it)
236 (*it)->iconify(); 236 m_screen.sendToWorkspace(dest, *it, false);
237} 237}
238 238
239 239
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:
58 void showAll(); 58 void showAll();
59 void hideAll(bool interrupt_moving); 59 void hideAll(bool interrupt_moving);
60 /// Iconify all windows on this workspace 60 /// Iconify all windows on this workspace
61 void removeAll(); 61 void removeAll(unsigned int dest);
62 void reconfigure(); 62 void reconfigure();
63 void shutdown(); 63 void shutdown();
64 64