diff options
Diffstat (limited to 'src/Gnome.cc')
-rw-r--r-- | src/Gnome.cc | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc index 18bd491..64a6cac 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.36 2004/06/28 13:33:05 fluxgen Exp $ | 22 | // $Id: Gnome.cc,v 1.37 2004/08/11 13:16:10 fluxgen Exp $ |
23 | 23 | ||
24 | #include "Gnome.hh" | 24 | #include "Gnome.hh" |
25 | 25 | ||
@@ -88,7 +88,6 @@ void Gnome::initForScreen(BScreen &screen) { | |||
88 | 88 | ||
89 | void Gnome::setupFrame(FluxboxWindow &win) { | 89 | void Gnome::setupFrame(FluxboxWindow &win) { |
90 | // load gnome state (take queues from the main window of the frame) | 90 | // load gnome state (take queues from the main window of the frame) |
91 | Display *disp = FbTk::App::instance()->display(); | ||
92 | Atom ret_type; | 91 | Atom ret_type; |
93 | int fmt; | 92 | int fmt; |
94 | unsigned long nitems, bytes_after; | 93 | unsigned long nitems, bytes_after; |
@@ -105,10 +104,9 @@ void Gnome::setupFrame(FluxboxWindow &win) { | |||
105 | } | 104 | } |
106 | 105 | ||
107 | // load gnome layer atom | 106 | // load gnome layer atom |
108 | if (XGetWindowProperty(disp, win.clientWindow(), | 107 | if (win.winClient().property(m_gnome_wm_win_layer, 0, 1, False, XA_CARDINAL, |
109 | m_gnome_wm_win_layer, 0, 1, False, XA_CARDINAL, | 108 | &ret_type, &fmt, &nitems, &bytes_after, |
110 | &ret_type, &fmt, &nitems, &bytes_after, | 109 | (unsigned char **) &data) && data) { |
111 | (unsigned char **) &data) == Success && data) { | ||
112 | flags = *data; | 110 | flags = *data; |
113 | setLayer(&win, flags); | 111 | setLayer(&win, flags); |
114 | XFree (data); | 112 | XFree (data); |
@@ -117,10 +115,9 @@ void Gnome::setupFrame(FluxboxWindow &win) { | |||
117 | } | 115 | } |
118 | 116 | ||
119 | // load gnome workspace atom | 117 | // load gnome workspace atom |
120 | if (XGetWindowProperty(disp, win.clientWindow(), | 118 | if (win.winClient().property(m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL, |
121 | m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL, | 119 | &ret_type, &fmt, &nitems, &bytes_after, |
122 | &ret_type, &fmt, &nitems, &bytes_after, | 120 | (unsigned char **) &data) && data) { |
123 | (unsigned char **) &data) == Success && data) { | ||
124 | unsigned int workspace_num = *data; | 121 | unsigned int workspace_num = *data; |
125 | if (win.workspaceNumber() != workspace_num) | 122 | if (win.workspaceNumber() != workspace_num) |
126 | win.screen().reassociateWindow(&win, workspace_num, false); | 123 | win.screen().reassociateWindow(&win, workspace_num, false); |
@@ -138,6 +135,11 @@ bool Gnome::propertyNotify(WinClient &winclient, Atom the_property) { | |||
138 | cerr<<__FILE__<<"("<<__FUNCTION__<<"): _WIN_STATE"<<endl; | 135 | cerr<<__FILE__<<"("<<__FUNCTION__<<"): _WIN_STATE"<<endl; |
139 | #endif // DEBUG | 136 | #endif // DEBUG |
140 | return true; | 137 | return true; |
138 | } else if (the_property == m_gnome_wm_win_layer) { | ||
139 | #ifdef DEBUG | ||
140 | cerr<<__FILE__<<"("<<__FUNCTION__<<"): _WIN_LAYER"<<endl; | ||
141 | #endif // DEBUG | ||
142 | return true; | ||
141 | } | 143 | } |
142 | return false; | 144 | return false; |
143 | } | 145 | } |
@@ -413,31 +415,56 @@ void Gnome::setLayer(FluxboxWindow *win, int layer) { | |||
413 | 415 | ||
414 | switch (layer) { | 416 | switch (layer) { |
415 | case WIN_LAYER_DESKTOP: | 417 | case WIN_LAYER_DESKTOP: |
418 | #ifdef DEBUG | ||
419 | cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_DESKTOP)"<<endl; | ||
420 | #endif // DEBUG | ||
416 | layer = Fluxbox::instance()->getDesktopLayer(); | 421 | layer = Fluxbox::instance()->getDesktopLayer(); |
417 | break; | 422 | break; |
418 | case WIN_LAYER_BELOW: | 423 | case WIN_LAYER_BELOW: |
424 | #ifdef DEBUG | ||
425 | cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_BELOW)"<<endl; | ||
426 | #endif // DEBUG | ||
419 | layer = Fluxbox::instance()->getBottomLayer(); | 427 | layer = Fluxbox::instance()->getBottomLayer(); |
420 | break; | 428 | break; |
421 | case WIN_LAYER_NORMAL: | 429 | case WIN_LAYER_NORMAL: |
430 | #ifdef DEBUG | ||
431 | cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_NORMAL)"<<endl; | ||
432 | #endif // DEBUG | ||
422 | layer = Fluxbox::instance()->getNormalLayer(); | 433 | layer = Fluxbox::instance()->getNormalLayer(); |
423 | break; | 434 | break; |
424 | case WIN_LAYER_ONTOP: | 435 | case WIN_LAYER_ONTOP: |
436 | #ifdef DEBUG | ||
437 | cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_ONTOP)"<<endl; | ||
438 | #endif // DEBUG | ||
425 | layer = Fluxbox::instance()->getTopLayer(); | 439 | layer = Fluxbox::instance()->getTopLayer(); |
426 | break; | 440 | break; |
427 | case WIN_LAYER_DOCK: | 441 | case WIN_LAYER_DOCK: |
442 | #ifdef DEBUG | ||
443 | cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_DOCK)"<<endl; | ||
444 | #endif // DEBUG | ||
428 | layer = Fluxbox::instance()->getDockLayer(); | 445 | layer = Fluxbox::instance()->getDockLayer(); |
429 | break; | 446 | break; |
430 | case WIN_LAYER_ABOVE_DOCK: | 447 | case WIN_LAYER_ABOVE_DOCK: |
448 | #ifdef DEBUG | ||
449 | cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_ABOVE_DOCK)"<<endl; | ||
450 | #endif // DEBUG | ||
431 | layer = Fluxbox::instance()->getAboveDockLayer(); | 451 | layer = Fluxbox::instance()->getAboveDockLayer(); |
432 | break; | 452 | break; |
433 | case WIN_LAYER_MENU: | 453 | case WIN_LAYER_MENU: |
454 | #ifdef DEBUG | ||
455 | cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_MENU)"<<endl; | ||
456 | #endif // DEBUG | ||
434 | layer = Fluxbox::instance()->getMenuLayer(); | 457 | layer = Fluxbox::instance()->getMenuLayer(); |
435 | break; | 458 | break; |
436 | default: | 459 | default: |
437 | // our windows are in the opposite direction to gnome | 460 | // our windows are in the opposite direction to gnome |
438 | layer = Fluxbox::instance()->getDesktopLayer() - layer; | 461 | layer = Fluxbox::instance()->getDesktopLayer() - layer; |
462 | #ifdef DEBUG | ||
463 | cerr<<"Gnome::setLayer("<<win->title()<<", "<<layer<<")"<<endl; | ||
464 | #endif // DEBUG | ||
439 | break; | 465 | break; |
440 | } | 466 | } |
467 | |||
441 | win->moveToLayer(layer); | 468 | win->moveToLayer(layer); |
442 | 469 | ||
443 | } | 470 | } |