diff options
author | rathnor <rathnor> | 2003-02-02 16:32:41 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-02-02 16:32:41 (GMT) |
commit | 1b063dcea92e0a7ac5008518fc5c13f03c055f54 (patch) | |
tree | 29d5b622c0870f06a94086ed463ab90e23bc673e /src/Gnome.cc | |
parent | 5244fc32447d2649a52a06dc84d96da94e9fd715 (diff) | |
download | fluxbox_pavel-1b063dcea92e0a7ac5008518fc5c13f03c055f54.zip fluxbox_pavel-1b063dcea92e0a7ac5008518fc5c13f03c055f54.tar.bz2 |
Integration of new Layering code, plus updates to the layering code itself
- new KeyActions: Raise/LowerLayer, AlwaysOnTop/Bottom, Top/BottomLayer
Added a "Quit" KeyAction
Diffstat (limited to 'src/Gnome.cc')
-rw-r--r-- | src/Gnome.cc | 71 |
1 files changed, 56 insertions, 15 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc index d484bde..7cf7f1c 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc | |||
@@ -19,10 +19,11 @@ | |||
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.6 2002/12/01 13:41:57 rathnor Exp $ | 22 | // $Id: Gnome.cc,v 1.7 2003/02/02 16:32:37 rathnor Exp $ |
23 | 23 | ||
24 | #include "Gnome.hh" | 24 | #include "Gnome.hh" |
25 | 25 | ||
26 | #include "fluxbox.hh" | ||
26 | #include "Window.hh" | 27 | #include "Window.hh" |
27 | #include "Screen.hh" | 28 | #include "Screen.hh" |
28 | 29 | ||
@@ -61,8 +62,8 @@ void Gnome::initForScreen(const BScreen &screen) { | |||
61 | m_gnome_wm_win_workspace_names, | 62 | m_gnome_wm_win_workspace_names, |
62 | m_gnome_wm_win_client_list, | 63 | m_gnome_wm_win_client_list, |
63 | m_gnome_wm_win_state, | 64 | m_gnome_wm_win_state, |
64 | m_gnome_wm_win_hints | 65 | m_gnome_wm_win_hints, |
65 | // m_gnome_wm_win_layer not supported yet | 66 | m_gnome_wm_win_layer |
66 | }; | 67 | }; |
67 | 68 | ||
68 | //list atoms that we support | 69 | //list atoms that we support |
@@ -96,8 +97,25 @@ void Gnome::setupWindow(FluxboxWindow &win) { | |||
96 | XFree (data); | 97 | XFree (data); |
97 | } | 98 | } |
98 | 99 | ||
99 | // make sure we get right workspace | 100 | // load gnome layer atom |
100 | updateWorkspace(win); | 101 | if (XGetWindowProperty(disp, win.getClientWindow(), |
102 | m_gnome_wm_win_layer, 0, 1, False, XA_CARDINAL, | ||
103 | &ret_type, &fmt, &nitems, &bytes_after, | ||
104 | (unsigned char **) &data) == Success && data) { | ||
105 | flags = *data; | ||
106 | setLayer(&win, flags); | ||
107 | XFree (data); | ||
108 | } | ||
109 | |||
110 | // load gnome layer atom | ||
111 | if (XGetWindowProperty(disp, win.getClientWindow(), | ||
112 | m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL, | ||
113 | &ret_type, &fmt, &nitems, &bytes_after, | ||
114 | (unsigned char **) &data) == Success && data) { | ||
115 | flags = *data; | ||
116 | win.getScreen()->reassociateWindow(&win, flags ,false); | ||
117 | XFree (data); | ||
118 | } | ||
101 | 119 | ||
102 | } | 120 | } |
103 | 121 | ||
@@ -209,6 +227,15 @@ void Gnome::updateState(FluxboxWindow &win) { | |||
209 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); | 227 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); |
210 | } | 228 | } |
211 | 229 | ||
230 | void Gnome::updateLayer(FluxboxWindow &win) { | ||
231 | //TODO - map from flux layers to gnome ones | ||
232 | int layernum = win.getLayerNum(); | ||
233 | XChangeProperty(BaseDisplay::getXDisplay(), win.getClientWindow(), | ||
234 | m_gnome_wm_win_layer, | ||
235 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&layernum, 1); | ||
236 | |||
237 | } | ||
238 | |||
212 | void Gnome::updateHints(FluxboxWindow &win) { | 239 | void Gnome::updateHints(FluxboxWindow &win) { |
213 | //TODO | 240 | //TODO |
214 | 241 | ||
@@ -258,7 +285,13 @@ bool Gnome::checkClientMessage(const XClientMessageEvent &ce, BScreen * const sc | |||
258 | cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_HINTS"<<endl; | 285 | cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_HINTS"<<endl; |
259 | #endif // DEBUG | 286 | #endif // DEBUG |
260 | 287 | ||
261 | } else | 288 | } else if (ce.message_type == m_gnome_wm_win_layer) { |
289 | #ifdef DEBUG | ||
290 | cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_LAYER"<<endl; | ||
291 | #endif // DEBUG | ||
292 | |||
293 | setLayer(win, ce.data.l[0]); | ||
294 | } else | ||
262 | return false; //the gnome atom wasn't found or not supported | 295 | return false; //the gnome atom wasn't found or not supported |
263 | 296 | ||
264 | return true; // we handled the atom | 297 | return true; // we handled the atom |
@@ -314,29 +347,37 @@ void Gnome::setState(FluxboxWindow *win, int state) { | |||
314 | */ | 347 | */ |
315 | } | 348 | } |
316 | 349 | ||
317 | void Gnome::setLayer(GnomeLayer layer) { | 350 | void Gnome::setLayer(FluxboxWindow *win, int layer) { |
318 | FluxboxWindow::WinLayer winlayer; | 351 | if (!win) return; |
319 | 352 | ||
353 | |||
320 | switch (layer) { | 354 | switch (layer) { |
321 | case WIN_LAYER_DESKTOP: | 355 | case WIN_LAYER_DESKTOP: |
322 | winlayer = FluxboxWindow::LAYER_BOTTOM; | 356 | layer = Fluxbox::instance()->getDesktopLayer(); |
323 | break; | 357 | break; |
324 | case WIN_LAYER_BELOW: | 358 | case WIN_LAYER_BELOW: |
325 | winlayer = FluxboxWindow::LAYER_BELOW; | 359 | layer = Fluxbox::instance()->getBottomLayer(); |
326 | break; | 360 | break; |
327 | case WIN_LAYER_NORMAL: | 361 | case WIN_LAYER_NORMAL: |
328 | winlayer = FluxboxWindow::LAYER_NORMAL; | 362 | layer = Fluxbox::instance()->getNormalLayer(); |
329 | break; | 363 | break; |
330 | case WIN_LAYER_ONTOP: | 364 | case WIN_LAYER_ONTOP: |
365 | layer = Fluxbox::instance()->getTopLayer(); | ||
366 | break; | ||
331 | case WIN_LAYER_DOCK: | 367 | case WIN_LAYER_DOCK: |
332 | case WIN_LAYER_ABOVE_DOCK: | 368 | layer = Fluxbox::instance()->getSlitLayer(); |
369 | break; | ||
370 | //case WIN_LAYER_ABOVE_DOCK: | ||
333 | case WIN_LAYER_MENU: | 371 | case WIN_LAYER_MENU: |
334 | winlayer = FluxboxWindow::LAYER_TOP; | 372 | layer = Fluxbox::instance()->getMenuLayer(); |
335 | break; | 373 | break; |
336 | default: | 374 | default: |
337 | winlayer = FluxboxWindow::LAYER_NORMAL; | 375 | // our windows are in the opposite direction to gnome |
376 | layer = Fluxbox::instance()->getDesktopLayer() - layer; | ||
338 | break; | 377 | break; |
339 | } | 378 | } |
379 | win->getScreen()->setLayer(*win->getLayerItem(),layer); | ||
380 | |||
340 | } | 381 | } |
341 | 382 | ||
342 | void Gnome::createAtoms() { | 383 | void Gnome::createAtoms() { |