aboutsummaryrefslogtreecommitdiff
path: root/src/Ewmh.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r--src/Ewmh.cc45
1 files changed, 42 insertions, 3 deletions
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
1244void 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
1223Ewmh::WindowState::WindowState(int t_x, int t_y, 1261Ewmh::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