aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-09-08 10:58:30 (GMT)
committerfluxgen <fluxgen>2002-09-08 10:58:30 (GMT)
commit29d81960467f75ce906062aa64e2a7df2bf32afb (patch)
treecfe872c810fc40d0f6f65fff223abf229a353071 /src
parent299083652681234304b3ee62c6aadc61a277e442 (diff)
downloadfluxbox_paul-29d81960467f75ce906062aa64e2a7df2bf32afb.zip
fluxbox_paul-29d81960467f75ce906062aa64e2a7df2bf32afb.tar.bz2
setupWindow and referenses
Diffstat (limited to 'src')
-rw-r--r--src/Gnome.cc50
1 files changed, 42 insertions, 8 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc
index 9a5d9cb..c7784c3 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.1 2002/09/07 20:32:44 fluxgen Exp $ 22// $Id: Gnome.cc,v 1.2 2002/09/08 10:58:30 fluxgen Exp $
23 23
24#include "Gnome.hh" 24#include "Gnome.hh"
25#include "Window.hh" 25#include "Window.hh"
@@ -77,6 +77,33 @@ void Gnome::initForScreen(const BScreen &screen) {
77 77
78} 78}
79 79
80void Gnome::setupWindow(FluxboxWindow &win) {
81 // load gnome state atom
82 Display *disp = BaseDisplay::getXDisplay();
83 Atom ret_type;
84 int fmt;
85 unsigned long nitems, bytes_after;
86 long flags, *data = 0;
87
88 if (XGetWindowProperty(disp, win.getClientWindow(),
89 m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL,
90 &ret_type, &fmt, &nitems, &bytes_after,
91 (unsigned char **) &data) == Success && data) {
92 flags = *data;
93 setState(&win, flags);
94 XFree (data);
95 }
96
97 if (XGetWindowProperty(disp, win.getClientWindow(),
98 m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL,
99 &ret_type, &fmt, &nitems, &bytes_after,
100 (unsigned char **)&data) == Success && data) {
101#ifdef DEBUG
102 cerr<<__FILE__<<"("<<__LINE__<<"): Workspace: "<<*data<<endl;
103#endif // DEBUG
104 }
105}
106
80void Gnome::updateClientList(const BScreen &screen) { 107void Gnome::updateClientList(const BScreen &screen) {
81 size_t num=0; 108 size_t num=0;
82 109
@@ -139,7 +166,7 @@ void Gnome::updateWorkspaceNames(const BScreen &screen) {
139 } 166 }
140 167
141 for (int i = 0; i < number_of_desks; i++) 168 for (int i = 0; i < number_of_desks; i++)
142 delete [] names[i]; 169 delete [] names[i];
143} 170}
144 171
145void Gnome::updateCurrentWorkspace(const BScreen &screen) { 172void Gnome::updateCurrentWorkspace(const BScreen &screen) {
@@ -159,22 +186,29 @@ void Gnome::updateWorkspaceCount(const BScreen &screen) {
159 (unsigned char *)&numworkspaces, 1); 186 (unsigned char *)&numworkspaces, 1);
160} 187}
161 188
162void Gnome::updateState(FluxboxWindow *win) { 189void Gnome::updateWorkspace(FluxboxWindow &win) {
190 int val = win.getWorkspaceNumber();
191 XChangeProperty(BaseDisplay::getXDisplay(), win.getClientWindow(),
192 m_gnome_wm_win_workspace,
193 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1);
194}
195
196void Gnome::updateState(FluxboxWindow &win) {
163 //translate to gnome win state 197 //translate to gnome win state
164 int state=0; 198 int state=0;
165 if (win->isStuck()) 199 if (win.isStuck())
166 state |= WIN_STATE_STICKY; 200 state |= WIN_STATE_STICKY;
167 if (win->isIconic()) 201 if (win.isIconic())
168 state |= WIN_STATE_MINIMIZED; 202 state |= WIN_STATE_MINIMIZED;
169 if (win->isShaded()) 203 if (win.isShaded())
170 state |= WIN_STATE_SHADED; 204 state |= WIN_STATE_SHADED;
171 205
172 XChangeProperty(BaseDisplay::getXDisplay(), win->getClientWindow(), 206 XChangeProperty(BaseDisplay::getXDisplay(), win.getClientWindow(),
173 m_gnome_wm_win_state, 207 m_gnome_wm_win_state,
174 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); 208 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1);
175} 209}
176 210
177void Gnome::updateHints(FluxboxWindow *win) { 211void Gnome::updateHints(FluxboxWindow &win) {
178 //TODO 212 //TODO
179 213
180} 214}