aboutsummaryrefslogtreecommitdiff
path: root/src/Gnome.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-19 22:43:48 (GMT)
committerfluxgen <fluxgen>2003-05-19 22:43:48 (GMT)
commitb17abb05c8a8ce19f18039b8c306c92daa7c9acf (patch)
tree05932a0be04238ef12608abe99bd6011e28926c6 /src/Gnome.cc
parent3027bf1341cf3ac82889846ceeb1e9cf7f955502 (diff)
downloadfluxbox_pavel-b17abb05c8a8ce19f18039b8c306c92daa7c9acf.zip
fluxbox_pavel-b17abb05c8a8ce19f18039b8c306c92daa7c9acf.tar.bz2
using property and changeProperty
Diffstat (limited to 'src/Gnome.cc')
-rw-r--r--src/Gnome.cc59
1 files changed, 27 insertions, 32 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc
index bb867ac..bafcd78 100644
--- a/src/Gnome.cc
+++ b/src/Gnome.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: Gnome.cc,v 1.24 2003/05/15 12:00:42 fluxgen Exp $ 22// $Id: Gnome.cc,v 1.25 2003/05/19 22:40:40 fluxgen Exp $
23 23
24#include "Gnome.hh" 24#include "Gnome.hh"
25 25
@@ -53,9 +53,9 @@ void Gnome::initForScreen(BScreen &screen) {
53 Window gnome_win = XCreateSimpleWindow(disp, 53 Window gnome_win = XCreateSimpleWindow(disp,
54 screen.rootWindow().window(), 0, 0, 5, 5, 0, 0, 0); 54 screen.rootWindow().window(), 0, 0, 5, 5, 0, 0, 0);
55 // supported WM check 55 // supported WM check
56 XChangeProperty(disp, screen.rootWindow().window(), 56 screen.rootWindow().changeProperty(m_gnome_wm_supporting_wm_check,
57 m_gnome_wm_supporting_wm_check, 57 XA_CARDINAL, 32,
58 XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); 58 PropModeReplace, (unsigned char *) &gnome_win, 1);
59 59
60 XChangeProperty(disp, gnome_win, 60 XChangeProperty(disp, gnome_win,
61 m_gnome_wm_supporting_wm_check, 61 m_gnome_wm_supporting_wm_check,
@@ -71,9 +71,10 @@ void Gnome::initForScreen(BScreen &screen) {
71 }; 71 };
72 72
73 //list atoms that we support 73 //list atoms that we support
74 XChangeProperty(disp, screen.rootWindow().window(), 74 screen.rootWindow().changeProperty(m_gnome_wm_prot,
75 m_gnome_wm_prot, XA_ATOM, 32, PropModeReplace, 75 XA_ATOM, 32, PropModeReplace,
76 (unsigned char *)gnomeatomlist, (sizeof gnomeatomlist)/sizeof gnomeatomlist[0]); 76 (unsigned char *)gnomeatomlist,
77 (sizeof gnomeatomlist)/sizeof gnomeatomlist[0]);
77 78
78 m_gnomewindows.push_back(gnome_win); 79 m_gnomewindows.push_back(gnome_win);
79 80
@@ -92,10 +93,9 @@ void Gnome::setupWindow(FluxboxWindow &win) {
92 unsigned long nitems, bytes_after; 93 unsigned long nitems, bytes_after;
93 long flags, *data = 0; 94 long flags, *data = 0;
94 95
95 if (XGetWindowProperty(disp, win.clientWindow(), 96 if (win.winClient().property(m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL,
96 m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL, 97 &ret_type, &fmt, &nitems, &bytes_after,
97 &ret_type, &fmt, &nitems, &bytes_after, 98 (unsigned char **) &data) && data) {
98 (unsigned char **) &data) == Success && data) {
99 flags = *data; 99 flags = *data;
100 setState(&win, flags); 100 setState(&win, flags);
101 XFree (data); 101 XFree (data);
@@ -172,11 +172,9 @@ void Gnome::updateClientList(BScreen &screen) {
172 } 172 }
173 //number of windows to show in client list 173 //number of windows to show in client list
174 num = win; 174 num = win;
175 XChangeProperty(FbTk::App::instance()->display(), 175 screen.rootWindow().changeProperty(m_gnome_wm_win_client_list,
176 screen.rootWindow().window(), 176 XA_CARDINAL, 32,
177 m_gnome_wm_win_client_list, 177 PropModeReplace, (unsigned char *)wl, num);
178 XA_CARDINAL, 32,
179 PropModeReplace, (unsigned char *)wl, num);
180 178
181 delete[] wl; 179 delete[] wl;
182} 180}
@@ -206,19 +204,16 @@ void Gnome::updateWorkspaceNames(BScreen &screen) {
206 204
207void Gnome::updateCurrentWorkspace(BScreen &screen) { 205void Gnome::updateCurrentWorkspace(BScreen &screen) {
208 int workspace = screen.currentWorkspaceID(); 206 int workspace = screen.currentWorkspaceID();
209 XChangeProperty(FbTk::App::instance()->display(), 207 screen.rootWindow().changeProperty(m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace,
210 screen.rootWindow().window(), 208 (unsigned char *)&workspace, 1);
211 m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace,
212 (unsigned char *)&workspace, 1);
213 209
214 updateClientList(screen); // make sure the client list is updated too 210 updateClientList(screen); // make sure the client list is updated too
215} 211}
216 212
217void Gnome::updateWorkspaceCount(BScreen &screen) { 213void Gnome::updateWorkspaceCount(BScreen &screen) {
218 int numworkspaces = screen.getCount(); 214 int numworkspaces = screen.getCount();
219 XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), 215 screen.rootWindow().changeProperty(m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace,
220 m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace, 216 (unsigned char *)&numworkspaces, 1);
221 (unsigned char *)&numworkspaces, 1);
222} 217}
223 218
224void Gnome::updateWorkspace(FluxboxWindow &win) { 219void Gnome::updateWorkspace(FluxboxWindow &win) {
@@ -227,9 +222,9 @@ void Gnome::updateWorkspace(FluxboxWindow &win) {
227 cerr<<__FILE__<<"("<<__LINE__<<"): setting workspace("<<val<< 222 cerr<<__FILE__<<"("<<__LINE__<<"): setting workspace("<<val<<
228 ") for window("<<&win<<")"<<endl; 223 ") for window("<<&win<<")"<<endl;
229#endif // DEBUG 224#endif // DEBUG
230 XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(), 225 win.winClient().changeProperty(m_gnome_wm_win_workspace,
231 m_gnome_wm_win_workspace, 226 XA_CARDINAL, 32, PropModeReplace,
232 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); 227 (unsigned char *)&val, 1);
233} 228}
234 229
235void Gnome::updateState(FluxboxWindow &win) { 230void Gnome::updateState(FluxboxWindow &win) {
@@ -242,18 +237,18 @@ void Gnome::updateState(FluxboxWindow &win) {
242 if (win.isShaded()) 237 if (win.isShaded())
243 state |= WIN_STATE_SHADED; 238 state |= WIN_STATE_SHADED;
244 239
245 XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(), 240 win.winClient().changeProperty(m_gnome_wm_win_state,
246 m_gnome_wm_win_state, 241 XA_CARDINAL, 32,
247 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); 242 PropModeReplace, (unsigned char *)&state, 1);
248} 243}
249 244
250void Gnome::updateLayer(FluxboxWindow &win) { 245void Gnome::updateLayer(FluxboxWindow &win) {
251 //TODO - map from flux layers to gnome ones 246 //TODO - map from flux layers to gnome ones
252 // our layers are in the opposite direction to GNOME 247 // our layers are in the opposite direction to GNOME
253 int layernum = Fluxbox::instance()->getDesktopLayer() - win.layerNum(); 248 int layernum = Fluxbox::instance()->getDesktopLayer() - win.layerNum();
254 XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(), 249 win.winClient().changeProperty(m_gnome_wm_win_layer,
255 m_gnome_wm_win_layer, 250 XA_CARDINAL, 32, PropModeReplace,
256 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&layernum, 1); 251 (unsigned char *)&layernum, 1);
257 252
258} 253}
259 254