aboutsummaryrefslogtreecommitdiff
path: root/src/Ewmh.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-14 12:13:36 (GMT)
committerfluxgen <fluxgen>2003-04-14 12:13:36 (GMT)
commitf4ce449632eeb85aaeae63f32a7165d71047cde0 (patch)
tree22c3cf8815c69cf4397d0567fd07327e988f9981 /src/Ewmh.cc
parent0c895209d2d1425389100e6be734b960475c6883 (diff)
downloadfluxbox_pavel-f4ce449632eeb85aaeae63f32a7165d71047cde0.zip
fluxbox_pavel-f4ce449632eeb85aaeae63f32a7165d71047cde0.tar.bz2
merged with embedded-tab-branch
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r--src/Ewmh.cc30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index f077932..c17bd92 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -19,15 +19,17 @@
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.14 2003/04/09 17:20:00 rathnor Exp $ 22// $Id: Ewmh.cc,v 1.15 2003/04/14 12:11:21 fluxgen Exp $
23 23
24#include "Ewmh.hh" 24#include "Ewmh.hh"
25 25
26#include "Screen.hh" 26#include "Screen.hh"
27#include "Window.hh" 27#include "Window.hh"
28#include "fluxbox.hh" 28#include "fluxbox.hh"
29#include "WinClient.hh"
29 30
30#include <iostream> 31#include <iostream>
32#include <algorithm>
31#include <new> 33#include <new>
32using namespace std; 34using namespace std;
33 35
@@ -116,8 +118,8 @@ void Ewmh::setupWindow(FluxboxWindow &win) {
116 unsigned int desktop = static_cast<unsigned int>(*data); 118 unsigned int desktop = static_cast<unsigned int>(*data);
117 if (desktop == 0xFFFFFFFF && !win.isStuck()) 119 if (desktop == 0xFFFFFFFF && !win.isStuck())
118 win.stick(); 120 win.stick();
119 else if (win.getScreen()) 121 else
120 win.getScreen()->sendToWorkspace(desktop, &win, false); 122 win.getScreen().sendToWorkspace(desktop, &win, false);
121 123
122 XFree(data); 124 XFree(data);
123 } 125 }
@@ -147,7 +149,15 @@ void Ewmh::updateClientList(BScreen &screen) {
147 Workspace::Windows::const_iterator it = (*workspace_it)->getWindowList().begin(); 149 Workspace::Windows::const_iterator it = (*workspace_it)->getWindowList().begin();
148 Workspace::Windows::const_iterator it_end = (*workspace_it)->getWindowList().end(); 150 Workspace::Windows::const_iterator it_end = (*workspace_it)->getWindowList().end();
149 for (; it != it_end; ++it) { 151 for (; it != it_end; ++it) {
150 wl[win++] = (*it)->getClientWindow(); 152 if ((*it)->numClients() == 1)
153 wl[win++] = (*it)->getClientWindow();
154 else {
155 // add every client in fluxboxwindow to list window list
156 std::list<WinClient *>::iterator client_it = (*it)->clientList().begin();
157 std::list<WinClient *>::iterator client_it_end = (*it)->clientList().end();
158 for (; client_it != client_it_end; ++client_it)
159 wl[win++] = (*client_it)->window();
160 }
151 } 161 }
152 } 162 }
153 163
@@ -207,11 +217,11 @@ void Ewmh::updateWorkspaceCount(BScreen &screen) {
207} 217}
208 218
209void Ewmh::updateState(FluxboxWindow &win) { 219void Ewmh::updateState(FluxboxWindow &win) {
210 220 //!! TODO
211} 221}
212 222
213void Ewmh::updateLayer(FluxboxWindow &win) { 223void Ewmh::updateLayer(FluxboxWindow &win) {
214 //TODO _NET_WM_WINDOW_TYPE 224 //!! TODO _NET_WM_WINDOW_TYPE
215} 225}
216 226
217void Ewmh::updateHints(FluxboxWindow &win) { 227void Ewmh::updateHints(FluxboxWindow &win) {
@@ -223,9 +233,11 @@ void Ewmh::updateWorkspace(FluxboxWindow &win) {
223 if (win.isStuck()) 233 if (win.isStuck())
224 workspace = 0xFFFFFFFF; // appear on all desktops/workspaces 234 workspace = 0xFFFFFFFF; // appear on all desktops/workspaces
225 235
226 XChangeProperty(FbTk::App::instance()->display(), win.getClientWindow(), 236 for_each(win.clientList().begin(),
227 m_net_wm_desktop, XA_CARDINAL, 32, PropModeReplace, 237 win.clientList().end(),
228 (unsigned char *)&workspace, 1); 238 FbTk::ChangeProperty(FbTk::App::instance()->display(),
239 m_net_wm_desktop, PropModeReplace,
240 (unsigned char *)&workspace, 1));
229} 241}
230 242
231// return true if we did handle the atom here 243// return true if we did handle the atom here