aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-02-07 14:41:52 (GMT)
committerfluxgen <fluxgen>2002-02-07 14:41:52 (GMT)
commit52ed0566210f7b49f06ac4cf8d49ff423d3268d7 (patch)
tree41e7315ba5a313fdde14be2579e70616467a0765
parent8043a7f3031706392a5ed684ebefbef23822a9ef (diff)
downloadfluxbox_paul-52ed0566210f7b49f06ac4cf8d49ff423d3268d7.zip
fluxbox_paul-52ed0566210f7b49f06ac4cf8d49ff423d3268d7.tar.bz2
added gnome win state
-rw-r--r--src/Window.cc63
1 files changed, 49 insertions, 14 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 67d772c..f3c3bc3 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.24 2002/02/04 06:53:14 fluxgen Exp $ 25// $Id: Window.cc,v 1.25 2002/02/07 14:41:52 fluxgen Exp $
26 26
27// stupid macros needed to access some functions in version 2 of the GNU C 27// stupid macros needed to access some functions in version 2 of the GNU C
28// library 28// library
@@ -196,7 +196,8 @@ tab(0)
196 getWMHints(); 196 getWMHints();
197 getWMNormalHints(); 197 getWMNormalHints();
198 198
199 #ifdef SLIT 199 #ifdef SLIT
200
200 if (client.initial_state == WithdrawnState) { 201 if (client.initial_state == WithdrawnState) {
201 screen->getSlit()->addClient(client.window); 202 screen->getSlit()->addClient(client.window);
202 throw NOERROR; 203 throw NOERROR;
@@ -391,17 +392,15 @@ tab(0)
391 } 392 }
392 393
393 setFocusFlag(false); 394 setFocusFlag(false);
394 /* 395
396 #ifdef GNOME
397 updateGnomeAtoms();
398 #endif
399
395 #ifdef DEBUG 400 #ifdef DEBUG
396 fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); 401 fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this);
397 #endif 402 #endif
398 */ 403
399 //TODO move this
400 #ifdef GNOME
401 int val = workspace_number;
402 XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeWorkspaceAtom(),
403 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1);
404 #endif
405 404
406} 405}
407 406
@@ -573,9 +572,10 @@ void FluxboxWindow::showError(FluxboxWindow::Error error) {
573#endif // DEBUG 572#endif // DEBUG
574} 573}
575 574
576Window FluxboxWindow::createToplevelWindow(int x, int y, unsigned int width, 575Window FluxboxWindow::createToplevelWindow(
577 unsigned int height, 576 int x, int y, unsigned int width,
578 unsigned int borderwidth) 577 unsigned int height,
578 unsigned int borderwidth)
579{ 579{
580 XSetWindowAttributes attrib_create; 580 XSetWindowAttributes attrib_create;
581 unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWColormap | 581 unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWColormap |
@@ -861,6 +861,39 @@ void FluxboxWindow::createButton(int type, ButtonEventProc pressed, ButtonEventP
861 b.released = released; 861 b.released = released;
862 buttonlist.push_back(b); 862 buttonlist.push_back(b);
863} 863}
864#ifdef GNOME
865void FluxboxWindow::updateGnomeAtoms() {
866 int val = workspace_number;
867 XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeWorkspaceAtom(),
868 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1);
869 long state = getGnomeWindowState();
870 XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeStateAtom(),
871 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1);
872 #ifdef DEBUG
873 cerr<<__FILE__<<"("<<__LINE__<<"): 0x"<<hex<<screen->getBaseDisplay()->getGnomeStateAtom()<<dec<<endl;
874 #endif
875}
876
877long FluxboxWindow::getGnomeWindowState() {
878 long state=0;
879 if (isStuck())
880 state |= BaseDisplay::WIN_STATE_STICKY;
881 if (isIconic())
882 state |= BaseDisplay::WIN_STATE_MINIMIZED;
883 if (isShaded())
884 state |= BaseDisplay::WIN_STATE_SHADED;
885 /*TODO: states:
886 WIN_STATE_MAXIMIZED_VERT = (1<<2), // window in maximized V state
887 WIN_STATE_MAXIMIZED_HORIZ = (1<<3), // window in maximized H state
888 WIN_STATE_HIDDEN = (1<<4), // not on taskbar but window visible
889 WIN_STATE_HID_WORKSPACE = (1<<6), // not on current desktop
890 WIN_STATE_HID_TRANSIENT = (1<<7), // owner of transient is hidden
891 WIN_STATE_FIXED_POSITION = (1<<8), // window is fixed in position even
892 WIN_STATE_ARRANGE_IGNORE = (1<<9) // ignore for auto arranging
893 */
894 return state;
895}
896#endif //!GNOME
864 897
865Window FluxboxWindow::findTitleButton(int type) { 898Window FluxboxWindow::findTitleButton(int type) {
866 for (unsigned int i=0; i<buttonlist.size(); i++) { 899 for (unsigned int i=0; i<buttonlist.size(); i++) {
@@ -1720,6 +1753,7 @@ void FluxboxWindow::setTab(bool flag) {
1720//-------------------------------------- 1753//--------------------------------------
1721void FluxboxWindow::iconify(void) { 1754void FluxboxWindow::iconify(void) {
1722 1755
1756
1723 if (iconic) 1757 if (iconic)
1724 return; 1758 return;
1725 1759
@@ -1748,9 +1782,10 @@ void FluxboxWindow::iconify(void) {
1748 if (tab) //if this window got a tab then iconify it too 1782 if (tab) //if this window got a tab then iconify it too
1749 tab->iconify(); 1783 tab->iconify();
1750 1784
1751 if (client.transient) 1785 if (client.transient) {
1752 if (! client.transient->iconic) 1786 if (! client.transient->iconic)
1753 client.transient->iconify(); 1787 client.transient->iconify();
1788 }
1754} 1789}
1755 1790
1756 1791