diff options
author | markt <markt> | 2006-07-22 07:15:24 (GMT) |
---|---|---|
committer | markt <markt> | 2006-07-22 07:15:24 (GMT) |
commit | 2d971ad48c038e730b4d90cbd6ebd75367cd07d6 (patch) | |
tree | 5e356eaa9a394e4ad65185795fb4ba48ac24b21e /src/Ewmh.cc | |
parent | a72fc5e00213eccb1fcf019566eea7c98fdb0611 (diff) | |
download | fluxbox-2d971ad48c038e730b4d90cbd6ebd75367cd07d6.zip fluxbox-2d971ad48c038e730b4d90cbd6ebd75367cd07d6.tar.bz2 |
ewmh compliance updates
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r-- | src/Ewmh.cc | 38 |
1 files changed, 37 insertions, 1 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 | ||
67 | Ewmh::Ewmh() { | 69 | Ewmh::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); |