diff options
author | fluxgen <fluxgen> | 2003-05-19 22:43:48 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-05-19 22:43:48 (GMT) |
commit | b17abb05c8a8ce19f18039b8c306c92daa7c9acf (patch) | |
tree | 05932a0be04238ef12608abe99bd6011e28926c6 /src/Ewmh.cc | |
parent | 3027bf1341cf3ac82889846ceeb1e9cf7f955502 (diff) | |
download | fluxbox-b17abb05c8a8ce19f18039b8c306c92daa7c9acf.zip fluxbox-b17abb05c8a8ce19f18039b8c306c92daa7c9acf.tar.bz2 |
using property and changeProperty
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r-- | src/Ewmh.cc | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc index d96a6d3..9df4967 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Ewmh.cc,v 1.25 2003/05/15 12:00:42 fluxgen Exp $ | 22 | // $Id: Ewmh.cc,v 1.26 2003/05/19 22:40:16 fluxgen Exp $ |
23 | 23 | ||
24 | #include "Ewmh.hh" | 24 | #include "Ewmh.hh" |
25 | 25 | ||
@@ -56,8 +56,8 @@ void Ewmh::initForScreen(BScreen &screen) { | |||
56 | if (wincheck != None) { | 56 | if (wincheck != None) { |
57 | m_windows.push_back(wincheck); | 57 | m_windows.push_back(wincheck); |
58 | 58 | ||
59 | XChangeProperty(disp, screen.rootWindow().window(), m_net_supporting_wm_check, XA_WINDOW, 32, | 59 | screen.rootWindow().changeProperty(m_net_supporting_wm_check, XA_WINDOW, 32, |
60 | PropModeReplace, (unsigned char *) &wincheck, 1); | 60 | PropModeReplace, (unsigned char *) &wincheck, 1); |
61 | XChangeProperty(disp, wincheck, m_net_supporting_wm_check, XA_WINDOW, 32, | 61 | XChangeProperty(disp, wincheck, m_net_supporting_wm_check, XA_WINDOW, 32, |
62 | PropModeReplace, (unsigned char *) &wincheck, 1); | 62 | PropModeReplace, (unsigned char *) &wincheck, 1); |
63 | 63 | ||
@@ -86,18 +86,16 @@ void Ewmh::initForScreen(BScreen &screen) { | |||
86 | m_net_supporting_wm_check | 86 | m_net_supporting_wm_check |
87 | }; | 87 | }; |
88 | 88 | ||
89 | XChangeProperty(disp, screen.rootWindow().window(), | 89 | screen.rootWindow().changeProperty(m_net_supported, XA_ATOM, 32, |
90 | m_net_supported, XA_ATOM, 32, | 90 | PropModeReplace, |
91 | PropModeReplace, | 91 | (unsigned char *) &atomsupported, |
92 | (unsigned char *) &atomsupported, | 92 | (sizeof atomsupported)/sizeof atomsupported[0]); |
93 | (sizeof atomsupported)/sizeof atomsupported[0]); | ||
94 | 93 | ||
95 | 94 | ||
96 | } | 95 | } |
97 | 96 | ||
98 | void Ewmh::setupWindow(FluxboxWindow &win) { | 97 | void Ewmh::setupWindow(FluxboxWindow &win) { |
99 | 98 | ||
100 | Display *disp = FbTk::App::instance()->display(); | ||
101 | Atom ret_type; | 99 | Atom ret_type; |
102 | int fmt; | 100 | int fmt; |
103 | unsigned long nitems, bytes_after; | 101 | unsigned long nitems, bytes_after; |
@@ -112,10 +110,9 @@ void Ewmh::setupWindow(FluxboxWindow &win) { | |||
112 | XFree(data); | 110 | XFree(data); |
113 | } | 111 | } |
114 | */ | 112 | */ |
115 | if (XGetWindowProperty(disp, win.clientWindow(), | 113 | if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL, |
116 | m_net_wm_desktop, 0, 1, False, XA_CARDINAL, | 114 | &ret_type, &fmt, &nitems, &bytes_after, |
117 | &ret_type, &fmt, &nitems, &bytes_after, | 115 | (unsigned char **) &data) && data) { |
118 | (unsigned char **) &data) == Success && data) { | ||
119 | unsigned int desktop = static_cast<unsigned int>(*data); | 116 | unsigned int desktop = static_cast<unsigned int>(*data); |
120 | if (desktop == 0xFFFFFFFF && !win.isStuck()) | 117 | if (desktop == 0xFFFFFFFF && !win.isStuck()) |
121 | win.stick(); | 118 | win.stick(); |
@@ -192,11 +189,9 @@ void Ewmh::updateClientList(BScreen &screen) { | |||
192 | 189 | ||
193 | //number of windows to show in client list | 190 | //number of windows to show in client list |
194 | num = win; | 191 | num = win; |
195 | XChangeProperty(FbTk::App::instance()->display(), | 192 | screen.rootWindow().changeProperty(m_net_client_list, |
196 | screen.rootWindow().window(), | 193 | XA_CARDINAL, 32, |
197 | m_net_client_list, | 194 | PropModeReplace, (unsigned char *)wl, num); |
198 | XA_CARDINAL, 32, | ||
199 | PropModeReplace, (unsigned char *)wl, num); | ||
200 | 195 | ||
201 | delete [] wl; | 196 | delete [] wl; |
202 | } | 197 | } |
@@ -224,18 +219,15 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) { | |||
224 | 219 | ||
225 | void Ewmh::updateCurrentWorkspace(BScreen &screen) { | 220 | void Ewmh::updateCurrentWorkspace(BScreen &screen) { |
226 | size_t workspace = screen.currentWorkspaceID(); | 221 | size_t workspace = screen.currentWorkspaceID(); |
227 | XChangeProperty(FbTk::App::instance()->display(), | 222 | screen.rootWindow().changeProperty(m_net_current_desktop, XA_CARDINAL, 32, PropModeReplace, |
228 | screen.rootWindow().window(), | 223 | (unsigned char *)&workspace, 1); |
229 | m_net_current_desktop, XA_CARDINAL, 32, PropModeReplace, | ||
230 | (unsigned char *)&workspace, 1); | ||
231 | 224 | ||
232 | } | 225 | } |
233 | 226 | ||
234 | void Ewmh::updateWorkspaceCount(BScreen &screen) { | 227 | void Ewmh::updateWorkspaceCount(BScreen &screen) { |
235 | size_t numworkspaces = screen.getCount(); | 228 | size_t numworkspaces = screen.getCount(); |
236 | XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), | 229 | screen.rootWindow().changeProperty(m_net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, |
237 | m_net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, | 230 | (unsigned char *)&numworkspaces, 1); |
238 | (unsigned char *)&numworkspaces, 1); | ||
239 | } | 231 | } |
240 | 232 | ||
241 | void Ewmh::updateState(FluxboxWindow &win) { | 233 | void Ewmh::updateState(FluxboxWindow &win) { |