]> Dogcows Code - chaz/openbox/blob - src/client.hh
e18de3c9ff7694ad1a31cda94a5296ec5e4c5328
[chaz/openbox] / src / client.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __client_hh
3 #define __client_hh
4
5 /*! @file client.hh
6 @brief The Client class maintains the state of a client window by handling
7 property changes on the window and some client messages
8 */
9
10 #include "screen.hh"
11 #include "otk/strut.hh"
12 #include "otk/rect.hh"
13 #include "otk/eventhandler.hh"
14 #include "otk/ustring.hh"
15
16 extern "C" {
17 #include <X11/Xlib.h>
18
19 #ifdef SHAPE
20 #include <X11/extensions/shape.h>
21 #endif // SHAPE
22 }
23
24 #include <string>
25 #include <list>
26
27 namespace ob {
28
29 class Frame;
30 class Screen;
31
32 struct Icon {
33 unsigned long w, h;
34 unsigned long *data;
35 };
36
37 //! The MWM Hints as retrieved from the window property
38 /*!
39 This structure only contains 3 elements, even though the Motif 2.0
40 structure contains 5. We only use the first 3, so that is all gets defined.
41 */
42 struct MwmHints {
43 unsigned long flags; //!< A bitmask of Client::MwmFlags values
44 unsigned long functions; //!< A bitmask of Client::MwmFunctions values
45 unsigned long decorations;//!< A bitmask of Client::MwmDecorations values
46 //! The number of elements in the Client::MwmHints struct
47 static const unsigned int elements = 3;
48 };
49
50 //! Maintains the state of a client window.
51 /*!
52 Client maintains the state of a client window. The state consists of the
53 hints that the application sets on the window, such as the title, or window
54 gravity.
55 <p>
56 Client also manages client messages for the client window. When the
57 application (or any application) requests something to be changed for the
58 client, it will call the ActionHandler (for client messages) or update the
59 class' member variables and call whatever is nessary to complete the
60 change (such as causing a redraw of the titlebar after the title is changed).
61 */
62 class Client : public otk::EventHandler {
63 public:
64
65 //! The frame window which decorates around the client window
66 /*!
67 NOTE: This should NEVER be used inside the client class's constructor!
68 */
69 Frame *frame;
70
71 //! Holds a list of Clients
72 typedef std::list<Client*> List;
73
74 //! The possible stacking layers a client window can be a part of
75 enum StackLayer {
76 Layer_Icon, //!< 0 - iconified windows, in any order at all
77 Layer_Desktop, //!< 1 - desktop windows
78 Layer_Below, //!< 2 - normal windows w/ below
79 Layer_Normal, //!< 3 - normal windows
80 Layer_Above, //!< 4 - normal windows w/ above
81 Layer_Top, //!< 5 - always-on-top-windows (docks?)
82 Layer_Fullscreen, //!< 6 - fullscreeen windows
83 Layer_Internal, //!< 7 - openbox windows/menus
84 NUM_LAYERS
85 };
86
87 //! Corners of the client window, used for anchor positions
88 enum Corner { TopLeft,
89 TopRight,
90 BottomLeft,
91 BottomRight };
92
93 //! Possible window types
94 enum WindowType { Type_Desktop, //!< A desktop (bottom-most window)
95 Type_Dock, //!< A dock bar/panel window
96 Type_Toolbar, //!< A toolbar window, pulled off an app
97 Type_Menu, //!< An unpinned menu from an app
98 Type_Utility, //!< A small utility window such as a palette
99 Type_Splash, //!< A splash screen window
100 Type_Dialog, //!< A dialog window
101 Type_Normal //!< A normal application window
102 };
103
104 //! Possible flags for MWM Hints (defined by Motif 2.0)
105 enum MwmFlags { MwmFlag_Functions = 1 << 0, //!< The MMW Hints define funcs
106 MwmFlag_Decorations = 1 << 1 //!< The MWM Hints define decor
107 };
108
109 //! Possible functions for MWM Hints (defined by Motif 2.0)
110 enum MwmFunctions { MwmFunc_All = 1 << 0, //!< All functions
111 MwmFunc_Resize = 1 << 1, //!< Allow resizing
112 MwmFunc_Move = 1 << 2, //!< Allow moving
113 MwmFunc_Iconify = 1 << 3, //!< Allow to be iconfied
114 MwmFunc_Maximize = 1 << 4 //!< Allow to be maximized
115 //MwmFunc_Close = 1 << 5 //!< Allow to be closed
116 };
117
118 //! Possible decorations for MWM Hints (defined by Motif 2.0)
119 enum MemDecorations { MwmDecor_All = 1 << 0, //!< All decorations
120 MwmDecor_Border = 1 << 1, //!< Show a border
121 MwmDecor_Handle = 1 << 2, //!< Show a handle (bottom)
122 MwmDecor_Title = 1 << 3, //!< Show a titlebar
123 //MwmDecor_Menu = 1 << 4, //!< Show a menu
124 MwmDecor_Iconify = 1 << 5, //!< Show an iconify button
125 MwmDecor_Maximize = 1 << 6 //!< Show a maximize button
126 };
127
128 //! The things the user can do to the client window
129 enum Function { Func_Resize = 1 << 0, //!< Allow resizing
130 Func_Move = 1 << 1, //!< Allow moving
131 Func_Iconify = 1 << 2, //!< Allow to be iconified
132 Func_Maximize = 1 << 3, //!< Allow to be maximized
133 Func_Shade = 1 << 4, //!< Allow to be shaded
134 Func_Fullscreen = 1 << 5, //!< Allow to be made fullscreen
135 Func_Close = 1 << 6 //!< Allow to be closed
136 };
137 //! Holds a bitmask of Client::Function values
138 typedef unsigned char FunctionFlags;
139
140 //! The decorations the client window wants to be displayed on it
141 enum Decoration { Decor_Titlebar = 1 << 0, //!< Display a titlebar
142 Decor_Handle = 1 << 1, //!< Display a handle (bottom)
143 Decor_Border = 1 << 2, //!< Display a border
144 Decor_Icon = 1 << 3, //!< Display the window's icon
145 Decor_Iconify = 1 << 4, //!< Display an iconify button
146 Decor_Maximize = 1 << 5, //!< Display a maximize button
147 //! Display a button to toggle the window's placement on
148 //! all desktops
149 Decor_AllDesktops = 1 << 6,
150 Decor_Close = 1 << 7 //!< Display a close button
151 };
152 //! Holds a bitmask of Client::Decoration values
153 typedef unsigned char DecorationFlags;
154
155 //! The event mask to grab on client windows
156 static const long event_mask = PropertyChangeMask | FocusChangeMask |
157 StructureNotifyMask;
158
159 //! The mask of events to not let propogate past the client
160 /*!
161 This makes things like xprop work on the client window, but means we have
162 to explicitly grab clicks that we want.
163 */
164 static const long no_propagate_mask = ButtonPressMask | ButtonReleaseMask |
165 ButtonMotionMask;
166
167 //! The number of unmap events to ignore on the window
168 int ignore_unmaps;
169
170 private:
171 //! The screen number on which the client resides
172 int _screen;
173
174 //! The actual window that this class is wrapping up
175 Window _window;
176
177 //! The id of the group the window belongs to
178 Window _group;
179
180 //! The client which this client is a transient (child) for
181 Client *_transient_for;
182
183 //! The clients which are transients (children) of this client
184 Client::List _transients;
185
186 //! The desktop on which the window resides (0xffffffff for all desktops)
187 unsigned int _desktop;
188
189 //! Normal window title
190 otk::ustring _title;
191 //! Window title when iconifiged
192 otk::ustring _icon_title;
193
194 //! The application that created the window
195 std::string _app_name;
196 //! The class of the window, can used for grouping
197 std::string _app_class;
198 //! The specified role of the window, used for identification
199 std::string _role;
200
201 //! The type of window (what its function is)
202 WindowType _type;
203
204 //! Position and size of the window
205 /*!
206 This will not always be the actual position of the window on screen, it is
207 rather, the position requested by the client, to which the window's gravity
208 is applied.
209 */
210 otk::Rect _area;
211
212 //! The window's strut
213 /*!
214 The strut defines areas of the screen that are marked off-bounds for window
215 placement. In theory, where this window exists.
216 */
217 otk::Strut _strut;
218
219 //! The logical size of the window
220 /*!
221 The "logical" size of the window is refers to the user's perception of the
222 size of the window, and is the value that should be displayed to the user.
223 For example, with xterms, this value it the number of characters being
224 displayed in the terminal, instead of the number of pixels.
225 */
226 otk::Size _logical_size;
227
228 //! Width of the border on the window.
229 /*!
230 The window manager will set this to 0 while the window is being managed,
231 but needs to restore it afterwards, so it is saved here.
232 */
233 int _border_width;
234
235 //! The minimum aspect ratio the client window can be sized to.
236 /*!
237 A value of 0 means this is ignored.
238 */
239 float _min_ratio;
240 //! The maximum aspect ratio the client window can be sized to.
241 /*!
242 A value of 0 means this is ignored.
243 */
244 float _max_ratio;
245
246 //! The minimum size of the client window
247 /*!
248 If the min is > the max, then the window is not resizable
249 */
250 otk::Size _min_size;
251 //! The maximum size of the client window
252 /*!
253 If the min is > the max, then the window is not resizable
254 */
255 otk::Size _max_size;
256 //! The size of increments to resize the client window by
257 otk::Size _size_inc;
258 //! The base size of the client window
259 /*!
260 This value should be subtracted from the window's actual size when
261 displaying its size to the user, or working with its min/max size
262 */
263 otk::Size _base_size;
264
265 //! Window decoration and functionality hints
266 MwmHints _mwmhints;
267
268 //! Where to place the decorated window in relation to the undecorated window
269 int _gravity;
270
271 //! The state of the window, one of WithdrawnState, IconicState, or
272 //! NormalState
273 long _wmstate;
274
275 //! True if the client supports the delete_window protocol
276 bool _delete_window;
277
278 //! Was the window's position requested by the application? if not, we should
279 //! place the window ourselves when it first appears
280 bool _positioned;
281
282 //! Can the window receive input focus?
283 bool _can_focus;
284 //! Urgency flag
285 bool _urgent;
286 //! Notify the window when it receives focus?
287 bool _focus_notify;
288 //! Does the client window have the input focus?
289 bool _focused;
290
291 //! The window uses shape extension to be non-rectangular?
292 bool _shaped;
293
294 //! The window is modal, so it must be processed before any windows it is
295 //! related to can be focused
296 bool _modal;
297 //! Only the window's titlebar is displayed
298 bool _shaded;
299 //! The window is iconified
300 bool _iconic;
301 //! The window is maximized to fill the screen vertically
302 bool _max_vert;
303 //! The window is maximized to fill the screen horizontally
304 bool _max_horz;
305 //! The window should not be displayed by pagers
306 bool _skip_pager;
307 //! The window should not be displayed by taskbars
308 bool _skip_taskbar;
309 //! The window is a 'fullscreen' window, and should be on top of all others
310 bool _fullscreen;
311 //! The window should be on top of other windows of the same type
312 bool _above;
313 //! The window should be underneath other windows of the same type
314 bool _below;
315
316 //! The layer in which the window will be stacked, windows in lower layers
317 //! are always below windows in higher layers.
318 StackLayer _layer;
319
320 //! A bitmask of values in the Client::Decoration enum
321 /*!
322 The values in the variable are the decorations that the client wants to be
323 displayed around it.
324 */
325 DecorationFlags _decorations;
326
327 //! A bitmask of values in the Client::Decoration enum.
328 /*!
329 Specifies the decorations that should NOT be displayed on the client.
330 */
331 DecorationFlags _disabled_decorations;
332
333 //! A bitmask of values in the Client::Function enum
334 /*!
335 The values in the variable specify the ways in which the user is allowed to
336 modify this window.
337 */
338 FunctionFlags _functions;
339
340 //! Icons for the client as specified on the client window
341 Icon *_icons;
342 //! The number of icons in _icons
343 int _nicons;
344
345 Pixmap _pixmap_icon;
346 Pixmap _pixmap_icon_mask;
347
348 //! Retrieves the window's initial gravity
349 void getGravity();
350 //! Retrieves the desktop hint's value and sets Client::_desktop
351 void getDesktop();
352 //! Retrieves the window's type and sets Client::_type
353 void getType();
354 //! Gets the MWM Hints and adjusts Client::_functions and
355 //! Client::_decorations
356 void getMwmHints();
357 //! Gets the position and size of the window and sets Client::_area
358 void getArea();
359 //! Gets the net_state hint and sets the boolean flags for any states set in
360 //! the hint
361 void getState();
362 //! Determines if the window uses the Shape extension and sets
363 //! Client::_shaped
364 void getShaped();
365
366 //! Set up what decor should be shown on the window and what functions should
367 //! be allowed (Client::_decorations and Client::_functions).
368 /*!
369 This also updates the NET_WM_ALLOWED_ACTIONS hint.
370 */
371 void setupDecorAndFunctions();
372
373 //! Sets the wm_state to the specified value
374 void setWMState(long state);
375 //! Adjusts the window's net_state
376 /*!
377 This should not be called as part of the window mapping process! It is for
378 use when updating the state post-mapping.<br>
379 Client::applyStartupState is used to do the same things during the mapping
380 process.
381 */
382 void setState(Atom action, long data1, long data2);
383
384 //! Sends the window to the specified desktop
385 void setDesktop(unsigned int desktop);
386
387 //! Calculates the stacking layer for the client window
388 void calcLayer();
389
390 //! Update the protocols that the window supports and adjusts things if they
391 //! change
392 void updateProtocols();
393 //! Updates the WMNormalHints and adjusts things if they change
394 void updateNormalHints();
395 //! Updates the WMHints and adjusts things if they change
396 /*!
397 @param initstate Whether to read the initial_state property from the
398 WMHints. This should only be used during the mapping
399 process.
400 */
401 void updateWMHints(bool initstate = false);
402 //! Updates the window's title
403 void updateTitle();
404 //! Updates the window's icon title
405 void updateIconTitle();
406 //! Updates the window's application name and class
407 void updateClass();
408 //! Updates the strut for the client
409 void updateStrut();
410 //! Updates the window's transient status, and any parents of it
411 void updateTransientFor();
412 //! Updates the window's icons
413 void updateIcons();
414 //! Updates the window's kwm icon
415 void updateKwmIcon();
416
417 //! Change the client's state hints to match the class' data
418 void changeState();
419 //! Change the allowed actions set on the client
420 void changeAllowedActions();
421
422 //! Request the client to close its window.
423 void close();
424
425 //! Shades or unshades the client window
426 /*!
427 @param shade true if the window should be shaded; false if it should be
428 unshaded.
429 */
430 void shade(bool shade);
431
432 //! Recursively searches the client 'tree' for a modal client, always skips
433 //! the topmost node (the window you're starting with).
434 Client *Client::searchModalTree(Client *node, Client *skip);
435
436 //! Recursively searches the client 'tree' for a focused client, always skips
437 //! the topmost node (the window you're starting with).
438 Client *Client::searchFocusTree(Client *node, Client *skip);
439
440 //! Fires the urgent callbacks which lets the user do what they want with
441 //! urgent windows
442 void fireUrgent();
443
444 //! Fullscreen's or unfullscreen's the client window
445 /*!
446 @param fs true if the window should be made fullscreen; false if it should
447 be returned to normal state.
448 @param savearea true to have the client's current size and position saved;
449 otherwise, they are not. You should not save when mapping a
450 new window that is set to fullscreen. This has no effect
451 when restoring a window from fullscreen.
452 */
453 void fullscreen(bool fs, bool savearea = true);
454
455 //! Iconifies or uniconifies the client window
456 /*!
457 @param iconic true if the window should be iconified; false if it should be
458 restored.
459 @param curdesk If iconic is false, then this determines if the window will
460 be uniconified to the current viewable desktop (true) or to
461 its previous desktop (false)
462 */
463 void iconify(bool iconic, bool curdesk = true);
464
465 //! Maximize or unmaximize the client window
466 /*!
467 @param max true if the window should be maximized; false if it should be
468 returned to normal size.
469 @param dir 0 to set both horz and vert, 1 to set horz, 2 to set vert.
470 @param savearea true to have the client's current size and position saved;
471 otherwise, they are not. You should not save when mapping a
472 new window that is set to fullscreen. This has no effect
473 when unmaximizing a window.
474 */
475 void maximize(bool max, int dir, bool savearea = true);
476
477 //! Internal version of the Client::move function
478 /*!
479 @param x The X coordinate to move to.
480 @param y The Y coordinate to move to.
481 */
482 void internal_move(int x, int y);
483 //! Internal version of the Client::resize function
484 /*!
485 This also maintains things like the client's minsize, and size increments.
486 @param anchor The corner to keep in the same position when resizing.
487 @param w The width component of the new size for the client.
488 @param h The height component of the new size for the client.
489 @param user Specifies whether this is a user-requested change or a
490 program requested change.
491 @param x An optional X coordinate to which the window will be moved
492 after resizing.
493 @param y An optional Y coordinate to which the window will be moved
494 after resizing.
495 The x and y coordinates must both be sepcified together, or they will have
496 no effect. When they are specified, the anchor is ignored.
497 */
498 void internal_resize(Corner anchor, int w, int h,
499 bool user = true, int x = INT_MIN, int y = INT_MIN);
500
501 //! Removes or reapplies the client's border to its window
502 /*!
503 Used when managing and unmanaging a window.
504 @param addborder true if adding the border to the client; false if removing
505 from the client
506 */
507 void toggleClientBorder(bool addborder);
508
509 //! Applies the states requested when the window mapped
510 /*!
511 This should be called only once, during the window mapping process. It
512 applies things like maximized, and fullscreen.
513 */
514 void applyStartupState();
515
516 public:
517 //! Constructs a new Client object around a specified window id
518 /*!
519 @param window The window id that the Client class should handle
520 @param screen The screen on which the window resides
521 */
522 Client(int screen, Window window);
523 //! Destroys the Client object
524 virtual ~Client();
525
526 //! Returns the screen on which the clien resides
527 inline int screen() const { return _screen; }
528
529 //! Returns the window id that the Client object is handling
530 inline Window window() const { return _window; }
531
532 //! Returns the type of the window, one of the Client::WindowType values
533 inline WindowType type() const { return _type; }
534 //! Returns if the window should be treated as a normal window.
535 /*!
536 Some windows (desktops, docks, splash screens) have special rules applied
537 to them in a number of places regarding focus or user interaction.
538 */
539 inline bool normal() const {
540 return ! (_type == Type_Desktop || _type == Type_Dock ||
541 _type == Type_Splash);
542 }
543
544 //! Returns the desktop on which the window resides
545 /*!
546 This value is a 0-based index.<br>
547 A value of 0xffffffff indicates that the window exists on all desktops.
548 */
549 inline unsigned int desktop() const { return _desktop; }
550 //! Returns the window's title
551 inline const otk::ustring &title() const { return _title; }
552 //! Returns the window's title when it is iconified
553 inline const otk::ustring &iconTitle() const { return _title; }
554 //! Returns the application's name to whom the window belongs
555 inline const std::string &appName() const { return _app_name; }
556 //! Returns the class of the window
557 inline const std::string &appClass() const { return _app_class; }
558 //! Returns the program-specified role of the window
559 inline const std::string &role() const { return _role; }
560 //! Returns if the window can be focused
561 /*!
562 @return true if the window can receive focus; otherwise, false
563 */
564 inline bool canFocus() const { return _can_focus; }
565 //! Returns if the window has indicated that it needs urgent attention
566 inline bool urgent() const { return _urgent; }
567 //! Returns if the window wants to be notified when it receives focus
568 inline bool focusNotify() const { return _focus_notify; }
569 //! Returns if the window is the focused window
570 inline bool focused() const { return _focused; }
571 //! Returns if the window uses the Shape extension
572 inline bool shaped() const { return _shaped; }
573 //! Returns the window's gravity
574 /*!
575 This value determines where to place the decorated window in relation to
576 its position without decorations.<br>
577 One of: NorthWestGravity, SouthWestGravity, EastGravity, ...,
578 SouthGravity, StaticGravity, ForgetGravity
579 */
580 inline int gravity() const { return _gravity; }
581 //! Returns if the application requested the initial position for the window
582 /*!
583 If the application did not request a position (this function returns false)
584 then the window should be placed intelligently by the window manager
585 initially
586 */
587 inline bool positionRequested() const { return _positioned; }
588 //! Returns the decorations that the client window wishes to be displayed on
589 //! it
590 inline DecorationFlags decorations() const { return _decorations; }
591 //! Returns the decorations that the user has requested to be disabled on the
592 //! client
593 inline DecorationFlags disabledDecorations() const
594 { return _disabled_decorations; }
595 //! Returns the functions that the user can perform on the window
596 inline FunctionFlags funtions() const { return _functions; }
597
598 //! Return the client this window is transient for
599 inline Client *transientFor() const { return _transient_for; }
600
601 //! Returns if the window is modal
602 /*!
603 If the window is modal, then no other windows that it is related to can get
604 focus while it exists/remains modal.
605 */
606 inline bool modal() const { return _modal; }
607 //! The window should not be displayed by pagers
608 inline bool skipPager() const { return _skip_pager; }
609 //! The window should not be displayed by taskbars
610 inline bool skipTaskbar() const { return _skip_taskbar; }
611 //! Returns if the window is shaded
612 /*!
613 When the window is shaded, only its titlebar is visible.
614 */
615 inline bool shaded() const { return _shaded; }
616 //! Returns if the window is in fullscreen mode
617 inline bool fullscreen() const { return _fullscreen; }
618 //! Returns if the window is iconified
619 /*!
620 When the window is iconified, it is not visible at all (except in iconbars/
621 panels/etc that want to show lists of iconified windows
622 */
623 inline bool iconic() const { return _iconic; }
624 //! Returns if the window is maximized vertically
625 inline bool maxVert() const { return _max_vert; }
626 //! Returns if the window is maximized horizontally
627 inline bool maxHorz() const { return _max_horz; }
628 //! Returns the window's stacking layer
629 inline StackLayer layer() const { return _layer; }
630
631 //! Returns the logical size of the window
632 /*!
633 The "logical" size of the window is refers to the user's perception of the
634 size of the window, and is the value that should be displayed to the user.
635 For example, with xterms, this value it the number of characters being
636 displayed in the terminal, instead of the number of pixels.
637 */
638 const otk::Size &logicalSize() const { return _logical_size; }
639
640 //! Returns the position and size of the client relative to the root window
641 /*!
642 Note that this value is *not* the size and position of the window's
643 frame, though the position will often line up.<br>
644 If you want the frame's area, use Frame::area() instead.
645 */
646 inline const otk::Rect &area() const { return _area; }
647
648 //! Returns the client's strut definition
649 inline const otk::Strut &strut() const { return _strut; }
650
651 //! Returns an icon for the window
652 /*!
653 The icon chosen will be the smallest icon available that is still bigger or
654 equal to the specified Size.<br>
655 If none that meet the requirements is found, the largest icon that is
656 smaller than the specified size will be returned.
657 */
658 const Icon *icon(const otk::Size &s) const;
659
660 //! Returns the pixmap for the pixmap icon specified on the window (or None)
661 /*!
662 The icon given by Client::icon should take precedence over this icon/mask.
663 */
664 Pixmap pixmapIcon() const { return _pixmap_icon; }
665 //! Returns the mask for the pixmap icon specified on the window (or None)
666 /*!
667 The icon given by Client::icon should take precedence over this icon/mask.
668 */
669 Pixmap pixmapIconMask() const { return _pixmap_icon_mask; }
670
671 //! Move the window (actually, its frame) to a position.
672 /*!
673 This moves the window so that the top-left corner of its frame will be at
674 the position specified.
675 @param x The X coordinate to move to.
676 @param y The Y coordinate to move to.
677 */
678 void move(int x, int y);
679
680 //! Resizes the client window, anchoring it in a given corner
681 /*!
682 This also maintains things like the client's minsize, and size increments.
683 @param anchor The corner to keep in the same position when resizing.
684 @param w The width component of the new size for the client.
685 @param h The height component of the new size for the client.
686 */
687 void resize(Corner anchor, int w, int h);
688
689 //! Reapplies the maximized state to the window
690 /*!
691 Use this to make the window readjust its maximized size to new
692 surroundings (struts, etc).
693 */
694 void remaximize();
695
696 //! Shows the window if it should be shown, or hides it
697 /*!
698 Used when changing desktops, the window's state, etc.
699 */
700 void showhide();
701
702 //! Choose a mask of decorations to not display on the client
703 /*!
704 Pass a value of 0 to the function to turn all decorations back on. Note
705 that you cannot add decorations to a window with this, you can only remove
706 decorations that would otherwise have been displayed.
707 @param flags The mask of values from Client::Decoration to specify which
708 decorations should not be displayed.
709 */
710 void disableDecorations(DecorationFlags flags);
711
712 //! Return a modal child of the client window
713 /*!
714 @return A modal child of the client window, or 0 if none was found.
715 */
716 Client *findModalChild();
717
718 //! Attempt to focus the client window
719 bool focus();
720
721 //! Remove focus from the client window
722 void unfocus() const;
723
724 //! Validate client, by making sure no Destroy or Unmap events exist in
725 //! the event queue for the window.
726 /*!
727 @return true if the client is valid; false if the client has already
728 been unmapped/destroyed, and so is invalid.
729 */
730 bool validate() const;
731
732 void installColormap(bool install) const;
733
734 virtual void focusHandler(const XFocusChangeEvent &e);
735 virtual void unfocusHandler(const XFocusChangeEvent &e);
736 virtual void propertyHandler(const XPropertyEvent &e);
737 virtual void clientMessageHandler(const XClientMessageEvent &e);
738 virtual void configureRequestHandler(const XConfigureRequestEvent &e);
739 virtual void unmapHandler(const XUnmapEvent &e);
740 virtual void destroyHandler(const XDestroyWindowEvent &e);
741 virtual void reparentHandler(const XReparentEvent &e);
742 virtual void mapRequestHandler(const XMapRequestEvent &e);
743 #if defined(SHAPE)
744 virtual void shapeHandler(const XShapeEvent &e);
745 #endif // SHAPE
746
747 friend void Screen::manageWindow(Window);
748 friend void Screen::unmanageWindow(Client *);
749 };
750
751 }
752
753 #endif // __client_hh
This page took 0.06619 seconds and 4 git commands to generate.