aboutsummaryrefslogtreecommitdiff
path: root/src/Window.hh
diff options
context:
space:
mode:
authormathias <mathias>2004-12-21 16:17:14 (GMT)
committermathias <mathias>2004-12-21 16:17:14 (GMT)
commitad10a3543e278aea0dd8e1fb83fa79b93025d14b (patch)
treed0ba04c54c53a027d6a39dd1c9a3853fcd6e0042 /src/Window.hh
parenta88d3b39ad76182bf120b8c69b80104f7b61cba8 (diff)
downloadfluxbox-ad10a3543e278aea0dd8e1fb83fa79b93025d14b.zip
fluxbox-ad10a3543e278aea0dd8e1fb83fa79b93025d14b.tar.bz2
fix a problem with enabling/disabling fullscreen-mode in gtk2-apps
* synchronize _NET_WM_STATE in Ewmh.cc * added FluxboxWindow::setFullscreen(bool) to Window.cc furthermore, if a window is in fullscreenmode any existing shape is disabled (looks pretty annoying in mplayer for example)
Diffstat (limited to 'src/Window.hh')
-rw-r--r--src/Window.hh46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/Window.hh b/src/Window.hh
index c20f8a9..aa6de85 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -71,12 +71,12 @@ public:
71 MwmHintsFunctions = (1l << 0), ///< use motif wm functions 71 MwmHintsFunctions = (1l << 0), ///< use motif wm functions
72 MwmHintsDecorations = (1l << 1) ///< use motif wm decorations 72 MwmHintsDecorations = (1l << 1) ///< use motif wm decorations
73 }; 73 };
74 74
75 /// Motif wm functions 75 /// Motif wm functions
76 enum MwmFunc{ 76 enum MwmFunc{
77 MwmFuncAll = (1l << 0), ///< all motif wm functions 77 MwmFuncAll = (1l << 0), ///< all motif wm functions
78 MwmFuncResize = (1l << 1), ///< resize 78 MwmFuncResize = (1l << 1), ///< resize
79 MwmFuncMove = (1l << 2), ///< move 79 MwmFuncMove = (1l << 2), ///< move
80 MwmFuncIconify = (1l << 3), ///< iconify 80 MwmFuncIconify = (1l << 3), ///< iconify
81 MwmFuncMaximize = (1l << 4), ///< maximize 81 MwmFuncMaximize = (1l << 4), ///< maximize
82 MwmFuncClose = (1l << 5) ///< close 82 MwmFuncClose = (1l << 5) ///< close
@@ -100,10 +100,10 @@ public:
100 ATTRIB_MAXVERT = 0x04, 100 ATTRIB_MAXVERT = 0x04,
101 ATTRIB_OMNIPRESENT = 0x08, 101 ATTRIB_OMNIPRESENT = 0x08,
102 ATTRIB_WORKSPACE = 0x10, 102 ATTRIB_WORKSPACE = 0x10,
103 ATTRIB_STACK = 0x20, 103 ATTRIB_STACK = 0x20,
104 ATTRIB_DECORATION = 0x40, 104 ATTRIB_DECORATION = 0x40,
105 ATTRIB_HIDDEN = 0x80, 105 ATTRIB_HIDDEN = 0x80,
106 }; 106 };
107 107
108 /** 108 /**
109 * Types of maximization 109 * Types of maximization
@@ -114,8 +114,8 @@ public:
114 MAX_VERT = 2, ///< maximize vertical 114 MAX_VERT = 2, ///< maximize vertical
115 MAX_FULL = 3 ///< maximize full 115 MAX_FULL = 3 ///< maximize full
116 }; 116 };
117 /** 117 /**
118 This enumeration represents individual decoration 118 This enumeration represents individual decoration
119 attributes, they can be OR-d together to get a mask. 119 attributes, they can be OR-d together to get a mask.
120 Useful for saving. 120 Useful for saving.
121 */ 121 */
@@ -165,7 +165,7 @@ public:
165 165
166 /// attach client to our client list and remove it from old window 166 /// attach client to our client list and remove it from old window
167 void attachClient(WinClient &client, int x=-1, int y=-1); 167 void attachClient(WinClient &client, int x=-1, int y=-1);
168 /// detach client (remove it from list) and create a new window for it 168 /// detach client (remove it from list) and create a new window for it
169 bool detachClient(WinClient &client); 169 bool detachClient(WinClient &client);
170 /// detach current working client if we have more than one 170 /// detach current working client if we have more than one
171 void detachCurrentClient(); 171 void detachCurrentClient();
@@ -199,6 +199,8 @@ public:
199 void kill(); 199 void kill();
200 /// set the window in withdrawn state 200 /// set the window in withdrawn state
201 void withdraw(bool interrupt_moving); 201 void withdraw(bool interrupt_moving);
202 /// set fullscreen
203 void setFullscreen(bool flag);
202 /// toggle maximize 204 /// toggle maximize
203 void maximize(int type = MAX_FULL); 205 void maximize(int type = MAX_FULL);
204 /// maximizes the window horizontal 206 /// maximizes the window horizontal
@@ -210,7 +212,7 @@ public:
210 /// toggles shade 212 /// toggles shade
211 void shade(); 213 void shade();
212 /// toggles sticky 214 /// toggles sticky
213 void stick(); 215 void stick();
214 void raise(); 216 void raise();
215 void lower(); 217 void lower();
216 void tempRaise(); 218 void tempRaise();
@@ -269,10 +271,13 @@ public:
269 void setDecorationMask(unsigned int mask); 271 void setDecorationMask(unsigned int mask);
270 272
271 /** 273 /**
272 @name accessors 274 @name accessors
273 */ 275 */
274 //@{ 276 //@{
275 // whether this window can be tabbed with other windows, 277
278 // @return NormalState | IconicState | WithdrawnState
279 unsigned int getWmState() const { return m_current_state; }
280 // whether this window can be tabbed with other windows,
276 // and others tabbed with it 281 // and others tabbed with it
277 inline void setTabable(bool tabable) { functions.tabable = tabable; } 282 inline void setTabable(bool tabable) { functions.tabable = tabable; }
278 inline bool isTabable() { return functions.tabable; } 283 inline bool isTabable() { return functions.tabable; }
@@ -280,12 +285,13 @@ public:
280 inline void setResizable(bool resizable) { functions.resize = resizable; } 285 inline void setResizable(bool resizable) { functions.resize = resizable; }
281 286
282 inline bool isFocusHidden() const { return (m_blackbox_attrib.flags & ATTRIB_HIDDEN); } 287 inline bool isFocusHidden() const { return (m_blackbox_attrib.flags & ATTRIB_HIDDEN); }
283 inline bool isIconHidden() const { return m_icon_hidden; } 288 inline bool isIconHidden() const { return m_icon_hidden; }
284 inline bool isManaged() const { return m_managed; } 289 inline bool isManaged() const { return m_managed; }
285 inline bool isFocused() const { return focused; } 290 inline bool isFocused() const { return focused; }
286 bool isVisible() const; 291 bool isVisible() const;
287 inline bool isIconic() const { return iconic; } 292 inline bool isIconic() const { return iconic; }
288 inline bool isShaded() const { return shaded; } 293 inline bool isShaded() const { return shaded; }
294 inline bool isFullscreen() const { return fullscreen; }
289 inline bool isMaximized() const { return maximized == MAX_FULL; } 295 inline bool isMaximized() const { return maximized == MAX_FULL; }
290 inline bool isIconifiable() const { return functions.iconify; } 296 inline bool isIconifiable() const { return functions.iconify; }
291 inline bool isMaximizable() const { return functions.maximize; } 297 inline bool isMaximizable() const { return functions.maximize; }
@@ -318,8 +324,8 @@ public:
318 const FbTk::Menu &menu() const { return *m_windowmenu.get(); } 324 const FbTk::Menu &menu() const { return *m_windowmenu.get(); }
319 325
320 326
321 // for extras to add menus. 327 // for extras to add menus.
322 // These menus will be marked internal, 328 // These menus will be marked internal,
323 // and deleted when the window dies (as opposed to Screen 329 // and deleted when the window dies (as opposed to Screen
324 void addExtraMenu(const char *label, FbTk::Menu *menu); 330 void addExtraMenu(const char *label, FbTk::Menu *menu);
325 void removeExtraMenu(FbTk::Menu *menu); 331 void removeExtraMenu(FbTk::Menu *menu);
@@ -341,7 +347,7 @@ public:
341 347
342 int layerNum() const { return m_layernum; } 348 int layerNum() const { return m_layernum; }
343 void setLayerNum(int layernum); 349 void setLayerNum(int layernum);
344 350
345 351
346 unsigned int titlebarHeight() const; 352 unsigned int titlebarHeight() const;
347 353
@@ -453,7 +459,7 @@ private:
453 459
454 // Window states 460 // Window states
455 bool moving, resizing, shaded, iconic, 461 bool moving, resizing, shaded, iconic,
456 focused, stuck, m_managed; 462 focused, stuck, m_managed, fullscreen;
457 463
458 int maximized; 464 int maximized;
459 465
@@ -474,9 +480,10 @@ private:
474 unsigned int m_last_resize_h, m_last_resize_w; // handles height/width for resize "window" 480 unsigned int m_last_resize_h, m_last_resize_w; // handles height/width for resize "window"
475 481
476 unsigned int m_workspace_number; 482 unsigned int m_workspace_number;
477 unsigned long m_current_state; 483 unsigned long m_current_state; // NormalState | IconicState | Withdrawn
478 484
479 Decoration m_old_decoration; 485 Decoration m_old_decoration;
486 unsigned int m_old_decoration_mask;
480 487
481 ClientList m_clientlist; 488 ClientList m_clientlist;
482 WinClient *m_client; ///< current client 489 WinClient *m_client; ///< current client
@@ -491,14 +498,14 @@ private:
491 maximize, close, menu, sticky, shade, tab, enabled; 498 maximize, close, menu, sticky, shade, tab, enabled;
492 } decorations; 499 } decorations;
493 500
494 bool m_toggled_decos; 501 bool m_toggled_decos;
495 502
496 struct _functions { 503 struct _functions {
497 bool resize, move, iconify, maximize, close, tabable; 504 bool resize, move, iconify, maximize, close, tabable;
498 } functions; 505 } functions;
499 506
500 bool m_shaped; ///< if the window is shaped with a mask 507 bool m_shaped; ///< if the window is shaped with a mask
501 bool m_icon_hidden; ///< if the window is in the iconbar 508 bool m_icon_hidden; ///< if the window is in the iconbar
502 int m_old_pos_x, m_old_pos_y; ///< old position so we can restore from maximized 509 int m_old_pos_x, m_old_pos_y; ///< old position so we can restore from maximized
503 unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state 510 unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state
504 int m_last_button_x, ///< last known x position of the mouse button 511 int m_last_button_x, ///< last known x position of the mouse button
@@ -507,6 +514,7 @@ private:
507 514
508 FbTk::XLayerItem m_layeritem; 515 FbTk::XLayerItem m_layeritem;
509 int m_layernum; 516 int m_layernum;
517 int m_old_layernum;
510 518
511 FbTk::FbWindow &m_parent; ///< window on which we draw move/resize rectangle (the "root window") 519 FbTk::FbWindow &m_parent; ///< window on which we draw move/resize rectangle (the "root window")
512 520