diff options
-rw-r--r-- | src/AtomHandler.hh | 2 | ||||
-rw-r--r-- | src/Ewmh.cc | 45 | ||||
-rw-r--r-- | src/Ewmh.hh | 7 | ||||
-rw-r--r-- | src/Window.cc | 4 | ||||
-rw-r--r-- | src/fluxbox.cc | 8 | ||||
-rw-r--r-- | src/fluxbox.hh | 2 |
6 files changed, 63 insertions, 5 deletions
diff --git a/src/AtomHandler.hh b/src/AtomHandler.hh index b44d92f..cec75d3 100644 --- a/src/AtomHandler.hh +++ b/src/AtomHandler.hh | |||
@@ -53,7 +53,7 @@ public: | |||
53 | virtual void updateState(FluxboxWindow &win) = 0; | 53 | virtual void updateState(FluxboxWindow &win) = 0; |
54 | virtual void updateHints(FluxboxWindow &win) = 0; | 54 | virtual void updateHints(FluxboxWindow &win) = 0; |
55 | virtual void updateLayer(FluxboxWindow &win) = 0; | 55 | virtual void updateLayer(FluxboxWindow &win) = 0; |
56 | 56 | virtual void updateFrameExtents(FluxboxWindow &win) { } | |
57 | virtual bool checkClientMessage(const XClientMessageEvent &ce, | 57 | virtual bool checkClientMessage(const XClientMessageEvent &ce, |
58 | BScreen * screen, WinClient * const winclient) = 0; | 58 | BScreen * screen, WinClient * const winclient) = 0; |
59 | 59 | ||
diff --git a/src/Ewmh.cc b/src/Ewmh.cc index af9343f..b80c4cf 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc | |||
@@ -140,6 +140,7 @@ void Ewmh::initForScreen(BScreen &screen) { | |||
140 | m_net_wm_window_type_dock, | 140 | m_net_wm_window_type_dock, |
141 | m_net_wm_window_type_desktop, | 141 | m_net_wm_window_type_desktop, |
142 | m_net_wm_window_type_splash, | 142 | m_net_wm_window_type_splash, |
143 | m_net_wm_window_type_dialog, | ||
143 | m_net_wm_window_type_normal, | 144 | m_net_wm_window_type_normal, |
144 | 145 | ||
145 | // window actions | 146 | // window actions |
@@ -168,6 +169,7 @@ void Ewmh::initForScreen(BScreen &screen) { | |||
168 | 169 | ||
169 | m_net_wm_moveresize, | 170 | m_net_wm_moveresize, |
170 | 171 | ||
172 | m_net_frame_extents, | ||
171 | 173 | ||
172 | // desktop properties | 174 | // desktop properties |
173 | m_net_wm_desktop, | 175 | m_net_wm_desktop, |
@@ -259,7 +261,6 @@ void Ewmh::setupFrame(FluxboxWindow &win) { | |||
259 | // we also assume it shouldn't be visible in any toolbar | 261 | // we also assume it shouldn't be visible in any toolbar |
260 | win.setFocusHidden(true); | 262 | win.setFocusHidden(true); |
261 | win.setIconHidden(true); | 263 | win.setIconHidden(true); |
262 | break; | ||
263 | } else if (atoms[l] == m_net_wm_window_type_desktop) { | 264 | } else if (atoms[l] == m_net_wm_window_type_desktop) { |
264 | /* | 265 | /* |
265 | * _NET_WM_WINDOW_TYPE_DESKTOP indicates a "false desktop" window | 266 | * _NET_WM_WINDOW_TYPE_DESKTOP indicates a "false desktop" window |
@@ -284,14 +285,28 @@ void Ewmh::setupFrame(FluxboxWindow &win) { | |||
284 | * is starting up. | 285 | * is starting up. |
285 | */ | 286 | */ |
286 | win.setDecoration(FluxboxWindow::DECOR_NONE); | 287 | win.setDecoration(FluxboxWindow::DECOR_NONE); |
288 | win.setFocusHidden(true); | ||
289 | win.setIconHidden(true); | ||
287 | win.setMovable(false); | 290 | win.setMovable(false); |
288 | } else if (atoms[l] == m_net_wm_window_type_normal) { | 291 | } else if (atoms[l] == m_net_wm_window_type_normal) { |
289 | // do nothing, this is ..normal.. | 292 | // do nothing, this is ..normal.. |
293 | } else if (atoms[l] == m_net_wm_window_type_dialog) { | ||
294 | // dialog windows should not be tabable | ||
295 | win.setTabable(false); | ||
290 | } | 296 | } |
291 | 297 | ||
292 | } | 298 | } |
293 | XFree(data); | 299 | XFree(data); |
294 | } | 300 | } else { |
301 | // if _NET_WM_WINDOW_TYPE not set and this window | ||
302 | // has transient_for the type must be set to _NET_WM_WINDOW_TYPE_DIALOG | ||
303 | if ( win.winClient().isTransient() ) { | ||
304 | win.winClient(). | ||
305 | changeProperty(m_net_wm_window_type, | ||
306 | XA_ATOM, 32, PropModeReplace, | ||
307 | (unsigned char*)&m_net_wm_window_type_dialog, 1); | ||
308 | } | ||
309 | } | ||
295 | 310 | ||
296 | setupState(win); | 311 | setupState(win); |
297 | 312 | ||
@@ -305,8 +320,11 @@ void Ewmh::setupFrame(FluxboxWindow &win) { | |||
305 | win.setWorkspace(desktop); | 320 | win.setWorkspace(desktop); |
306 | 321 | ||
307 | XFree(data); | 322 | XFree(data); |
308 | } else | 323 | } else { |
309 | updateWorkspace(win); | 324 | updateWorkspace(win); |
325 | } | ||
326 | |||
327 | updateFrameExtents(win); | ||
310 | 328 | ||
311 | } | 329 | } |
312 | 330 | ||
@@ -940,6 +958,7 @@ void Ewmh::createAtoms() { | |||
940 | m_net_wm_window_type_dock = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DOCK", False); | 958 | m_net_wm_window_type_dock = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DOCK", False); |
941 | m_net_wm_window_type_desktop = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DESKTOP", False); | 959 | m_net_wm_window_type_desktop = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DESKTOP", False); |
942 | m_net_wm_window_type_splash = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_SPLASH", False); | 960 | m_net_wm_window_type_splash = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_SPLASH", False); |
961 | m_net_wm_window_type_dialog = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DIALOG", False); | ||
943 | m_net_wm_window_type_normal = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_NORMAL", False); | 962 | m_net_wm_window_type_normal = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_NORMAL", False); |
944 | 963 | ||
945 | // state atom and the supported state atoms | 964 | // state atom and the supported state atoms |
@@ -976,6 +995,8 @@ void Ewmh::createAtoms() { | |||
976 | m_net_wm_pid = XInternAtom(disp, "_NET_WM_PID", False); | 995 | m_net_wm_pid = XInternAtom(disp, "_NET_WM_PID", False); |
977 | m_net_wm_handled_icons = XInternAtom(disp, "_NET_WM_HANDLED_ICONS", False); | 996 | m_net_wm_handled_icons = XInternAtom(disp, "_NET_WM_HANDLED_ICONS", False); |
978 | 997 | ||
998 | m_net_frame_extents = XInternAtom(disp, "_NET_FRAME_EXTENTS", False); | ||
999 | |||
979 | m_net_wm_ping = XInternAtom(disp, "_NET_WM_PING", False); | 1000 | m_net_wm_ping = XInternAtom(disp, "_NET_WM_PING", False); |
980 | utf8_string = XInternAtom(disp, "UTF8_STRING", False); | 1001 | utf8_string = XInternAtom(disp, "UTF8_STRING", False); |
981 | } | 1002 | } |
@@ -1220,6 +1241,23 @@ void Ewmh::setupState(FluxboxWindow &win) { | |||
1220 | } | 1241 | } |
1221 | } | 1242 | } |
1222 | 1243 | ||
1244 | void Ewmh::updateFrameExtents(FluxboxWindow &win) { | ||
1245 | int extents[4]; | ||
1246 | extents[0] = win.frame().x(); | ||
1247 | extents[1] = win.frame().x() + win.frame().width(); | ||
1248 | extents[2] = win.frame().y(); | ||
1249 | extents[3] = win.frame().y() + win.frame().height(); | ||
1250 | |||
1251 | FluxboxWindow::ClientList::iterator it = win.clientList().begin(); | ||
1252 | FluxboxWindow::ClientList::iterator it_end = win.clientList().end(); | ||
1253 | for (; it != it_end; ++it) { | ||
1254 | (*it)->changeProperty(m_net_frame_extents, | ||
1255 | XA_CARDINAL, 32, PropModeReplace, | ||
1256 | (unsigned char *)extents, 4); | ||
1257 | } | ||
1258 | } | ||
1259 | |||
1260 | |||
1223 | Ewmh::WindowState::WindowState(int t_x, int t_y, | 1261 | Ewmh::WindowState::WindowState(int t_x, int t_y, |
1224 | unsigned int t_width, | 1262 | unsigned int t_width, |
1225 | unsigned int t_height, | 1263 | unsigned int t_height, |
@@ -1255,3 +1293,4 @@ void Ewmh::saveState(FluxboxWindow &win, WindowState *state) { | |||
1255 | m_savedstate[&win] = state; | 1293 | m_savedstate[&win] = state; |
1256 | } | 1294 | } |
1257 | 1295 | ||
1296 | |||
diff --git a/src/Ewmh.hh b/src/Ewmh.hh index 6044f7c..1643d17 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh | |||
@@ -64,6 +64,7 @@ public: | |||
64 | 64 | ||
65 | void setFullscreen(FluxboxWindow &win, bool value); | 65 | void setFullscreen(FluxboxWindow &win, bool value); |
66 | 66 | ||
67 | void updateFrameExtents(FluxboxWindow &win); | ||
67 | private: | 68 | private: |
68 | 69 | ||
69 | typedef struct WindowState { | 70 | typedef struct WindowState { |
@@ -83,6 +84,7 @@ private: | |||
83 | 84 | ||
84 | void setupState(FluxboxWindow &win); | 85 | void setupState(FluxboxWindow &win); |
85 | 86 | ||
87 | |||
86 | // root window properties | 88 | // root window properties |
87 | Atom m_net_supported, | 89 | Atom m_net_supported, |
88 | m_net_client_list, | 90 | m_net_client_list, |
@@ -110,6 +112,7 @@ private: | |||
110 | m_net_wm_window_type_dock, | 112 | m_net_wm_window_type_dock, |
111 | m_net_wm_window_type_desktop, | 113 | m_net_wm_window_type_desktop, |
112 | m_net_wm_window_type_splash, | 114 | m_net_wm_window_type_splash, |
115 | m_net_wm_window_type_dialog, | ||
113 | m_net_wm_window_type_normal, | 116 | m_net_wm_window_type_normal, |
114 | 117 | ||
115 | // states | 118 | // states |
@@ -137,7 +140,9 @@ private: | |||
137 | m_net_wm_action_close, | 140 | m_net_wm_action_close, |
138 | 141 | ||
139 | m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid, | 142 | m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid, |
140 | m_net_wm_handled_icons; | 143 | m_net_wm_handled_icons, |
144 | |||
145 | m_net_frame_extents; | ||
141 | 146 | ||
142 | // application protocols | 147 | // application protocols |
143 | Atom m_net_wm_ping; | 148 | Atom m_net_wm_ping; |
diff --git a/src/Window.cc b/src/Window.cc index 2311634..13167e7 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -3900,6 +3900,10 @@ void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) { | |||
3900 | screen().updateNetizenConfigNotify(event); | 3900 | screen().updateNetizenConfigNotify(event); |
3901 | } | 3901 | } |
3902 | } // end for | 3902 | } // end for |
3903 | |||
3904 | if (send_to_netizens) { | ||
3905 | Fluxbox::instance()->updateFrameExtents(*this); | ||
3906 | } | ||
3903 | } | 3907 | } |
3904 | 3908 | ||
3905 | 3909 | ||
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 70c5993..94c9730 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -1847,3 +1847,11 @@ void Fluxbox::watchKeyRelease(BScreen &screen, unsigned int mods) { | |||
1847 | screen.rootWindow().window(), True, | 1847 | screen.rootWindow().window(), True, |
1848 | GrabModeAsync, GrabModeAsync, CurrentTime); | 1848 | GrabModeAsync, GrabModeAsync, CurrentTime); |
1849 | } | 1849 | } |
1850 | |||
1851 | void Fluxbox::updateFrameExtents(FluxboxWindow &win) { | ||
1852 | AtomHandlerContainerIt it = m_atomhandler.begin(); | ||
1853 | AtomHandlerContainerIt it_end = m_atomhandler.end(); | ||
1854 | for (; it != it_end; ++it ) { | ||
1855 | (*it).first->updateFrameExtents(win); | ||
1856 | } | ||
1857 | } | ||
diff --git a/src/fluxbox.hh b/src/fluxbox.hh index c3936c7..206fcd4 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh | |||
@@ -182,6 +182,8 @@ public: | |||
182 | * @param old_screen the old screen if any, can be the same as new screen | 182 | * @param old_screen the old screen if any, can be the same as new screen |
183 | */ | 183 | */ |
184 | void updateFocusedWindow(BScreen *screen, BScreen *old_screen); | 184 | void updateFocusedWindow(BScreen *screen, BScreen *old_screen); |
185 | /// todo, remove this. just temporary | ||
186 | void updateFrameExtents(FluxboxWindow &win); | ||
185 | 187 | ||
186 | void attachSignals(FluxboxWindow &win); | 188 | void attachSignals(FluxboxWindow &win); |
187 | void attachSignals(WinClient &winclient); | 189 | void attachSignals(WinClient &winclient); |