• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kwin
 

kwin

  • kwin
client.h
1 /*****************************************************************
2  KWin - the KDE window manager
3  This file is part of the KDE project.
4 
5 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
7 
8 You can Freely distribute this program under the GNU General Public
9 License. See the file "COPYING" for the exact licensing terms.
10 ******************************************************************/
11 
12 #ifndef KWIN_CLIENT_H
13 #define KWIN_CLIENT_H
14 
15 #include <tqframe.h>
16 #include <tqvbox.h>
17 #include <tqpixmap.h>
18 #include <netwm.h>
19 #include <kdebug.h>
20 #include <assert.h>
21 #include <kshortcut.h>
22 #include <X11/X.h>
23 #include <X11/Xlib.h>
24 #include <X11/Xutil.h>
25 #include <fixx11h.h>
26 
27 #include "utils.h"
28 #include "options.h"
29 #include "workspace.h"
30 #include "kdecoration.h"
31 #include "rules.h"
32 
33 class TQTimer;
34 class KProcess;
35 class KStartupInfoData;
36 
37 namespace KWinInternal
38 {
39 
40 class Workspace;
41 class Client;
42 class WinInfo;
43 class SessionInfo;
44 class Bridge;
45 
46 class Client : public TQObject, public KDecorationDefines
47  {
48  Q_OBJECT
49  public:
50  Client( Workspace *ws );
51  Window window() const;
52  Window frameId() const;
53  Window wrapperId() const;
54  Window decorationId() const;
55 
56  Workspace* workspace() const;
57  const Client* transientFor() const;
58  Client* transientFor();
59  bool isTransient() const;
60  bool isModalSystemNotification() const;
61  bool groupTransient() const;
62  bool wasOriginallyGroupTransient() const;
63  ClientList mainClients() const; // call once before loop , is not indirect
64  bool hasTransient( const Client* c, bool indirect ) const;
65  const ClientList& transients() const; // is not indirect
66  void checkTransient( Window w );
67  Client* findModal();
68  const Group* group() const;
69  Group* group();
70  void checkGroup( Group* gr = NULL, bool force = false );
71  void changeClientLeaderGroup( Group* gr );
72  // prefer isXXX() instead
73  NET::WindowType windowType( bool direct = false, int supported_types = SUPPORTED_WINDOW_TYPES_MASK ) const;
74  const WindowRules* rules() const;
75  void removeRule( Rules* r );
76  void setupWindowRules( bool ignore_temporary );
77  void applyWindowRules();
78  void updateWindowRules();
79 
80  TQRect geometry() const;
81  TQSize size() const;
82  TQSize minSize() const;
83  TQSize maxSize() const;
84  TQPoint pos() const;
85  TQRect rect() const;
86  int x() const;
87  int y() const;
88  int width() const;
89  int height() const;
90  TQPoint clientPos() const; // inside of geometry()
91  TQSize clientSize() const;
92 
93  bool windowEvent( XEvent* e );
94  virtual bool eventFilter( TQObject* o, TQEvent* e );
95 
96  bool manage( Window w, bool isMapped );
97 
98  void releaseWindow( bool on_shutdown = false );
99 
100  enum Sizemode // how to resize the window in order to obey constains (mainly aspect ratios)
101  {
102  SizemodeAny,
103  SizemodeFixedW, // try not to affect width
104  SizemodeFixedH, // try not to affect height
105  SizemodeMax // try not to make it larger in either direction
106  };
107  TQSize adjustedSize( const TQSize&, Sizemode mode = SizemodeAny ) const;
108  TQSize adjustedSize() const;
109 
110  TQPixmap icon() const;
111  TQPixmap miniIcon() const;
112 
113  bool isActive() const;
114  void setActive( bool, bool updateOpacity = true );
115 
116  int desktop() const;
117  void setDesktop( int );
118  bool isOnDesktop( int d ) const;
119  bool isOnCurrentDesktop() const;
120  bool isOnAllDesktops() const;
121  void setOnAllDesktops( bool set );
122 
123  bool isOnScreen( int screen ) const; // true if it's at least partially there
124  int screen() const; // the screen where the center is
125 
126  // !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
127  bool isShown( bool shaded_is_shown ) const;
128 
129  bool isShade() const; // true only for ShadeNormal
130  ShadeMode shadeMode() const; // prefer isShade()
131  void setShade( ShadeMode mode );
132  bool isShadeable() const;
133 
134  bool isMinimized() const;
135  bool isMaximizable() const;
136  TQRect geometryRestore() const;
137  MaximizeMode maximizeModeRestore() const;
138  MaximizeMode maximizeMode() const;
139  bool isMinimizable() const;
140  void setMaximize( bool vertically, bool horizontally );
141 
142  void setFullScreen( bool set, bool user );
143  bool isFullScreen() const;
144  bool isFullScreenable( bool fullscreen_hack = false ) const;
145  bool userCanSetFullScreen() const;
146  TQRect geometryFSRestore() const { return geom_fs_restore; } // only for session saving
147  int fullScreenMode() const { return fullscreen_mode; } // only for session saving
148 
149  bool isUserNoBorder() const;
150  void setUserNoBorder( bool set );
151  bool userCanSetNoBorder() const;
152  bool noBorder() const;
153 
154  bool skipTaskbar( bool from_outside = false ) const;
155  void setSkipTaskbar( bool set, bool from_outside );
156 
157  bool skipPager() const;
158  void setSkipPager( bool );
159 
160  bool keepAbove() const;
161  void setKeepAbove( bool );
162  bool keepBelow() const;
163  void setKeepBelow( bool );
164  Layer layer() const;
165  Layer belongsToLayer() const;
166  void invalidateLayer();
167 
168  void setModal( bool modal );
169  bool isModal() const;
170 
171  // auxiliary functions, depend on the windowType
172  bool wantsTabFocus() const;
173  bool wantsInput() const;
174  bool hasNETSupport() const;
175  bool isMovable() const;
176  bool isDesktop() const;
177  bool isDock() const;
178  bool isToolbar() const;
179  bool isTopMenu() const;
180  bool isMenu() const;
181  bool isNormalWindow() const; // normal as in 'NET::Normal or NET::Unknown non-transient'
182  bool isDialog() const;
183  bool isSplash() const;
184  bool isUtility() const;
185  // returns true for "special" windows and false for windows which are "normal"
186  // (normal=window which has a border, can be moved by the user, can be closed, etc.)
187  // true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
188  // false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
189  bool isSpecialWindow() const;
190 
191  bool isResizable() const;
192  bool isCloseable() const; // may be closed by the user (may have a close button)
193 
194  void takeActivity( int flags, bool handled, allowed_t ); // takes ActivityFlags as arg (in utils.h)
195  void takeFocus( allowed_t );
196  void demandAttention( bool set = true );
197 
198  void setMask( const TQRegion& r, int mode = X::Unsorted );
199  TQRegion mask() const;
200 
201  void updateDecoration( bool check_workspace_pos, bool force = false );
202  void checkBorderSizes();
203 
204  // drop shadow
205  bool isShadowed() const;
206  void setShadowed(bool shadowed);
207  Window shadowId() const;
208  // Aieee, a friend function! Unpleasant, yes, but it's needed by
209  // raiseClient() to redraw a window's shadow when it is active prior to
210  // being raised.
211  friend void Workspace::raiseClient(Client *);
212  // Wouldn't you know it, friend functions breed. This one's needed to
213  // enable a DCOP function that causes all shadows obscuring a changed
214  // window to be redrawn.
215  friend void Workspace::updateOverlappingShadows(WId);
216 
217  // shape extensions
218  bool shape() const;
219  void updateShape();
220 
221  void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
222  void setGeometry( const TQRect& r, ForceGeometry_t force = NormalGeometrySet );
223  void move( int x, int y, ForceGeometry_t force = NormalGeometrySet );
224  void move( const TQPoint & p, ForceGeometry_t force = NormalGeometrySet );
225  // plainResize() simply resizes
226  void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
227  void plainResize( const TQSize& s, ForceGeometry_t force = NormalGeometrySet );
228  // resizeWithChecks() resizes according to gravity, and checks workarea position
229  void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
230  void resizeWithChecks( const TQSize& s, ForceGeometry_t force = NormalGeometrySet );
231  void keepInArea( TQRect area, bool partial = false );
232 
233  void growHorizontal();
234  void shrinkHorizontal();
235  void growVertical();
236  void shrinkVertical();
237 
238  bool providesContextHelp() const;
239  KShortcut shortcut() const;
240  void setShortcut( const TQString& cut );
241 
242  bool performMouseCommand( Options::MouseCommand, TQPoint globalPos, bool handled = false );
243 
244  TQCString windowRole() const;
245  TQCString sessionId();
246  TQCString resourceName() const;
247  TQCString resourceClass() const;
248  TQCString wmCommand();
249  TQCString wmClientMachine( bool use_localhost ) const;
250  Window wmClientLeader() const;
251  pid_t pid() const;
252 
253  TQRect adjustedClientArea( const TQRect& desktop, const TQRect& area ) const;
254 
255  Colormap colormap() const;
256 
257  // updates visibility depending on being shaded, virtual desktop, etc.
258  void updateVisibility();
259  // hides a client - basically like minimize, but without effects, it's simply hidden
260  void hideClient( bool hide );
261 
262  TQString caption( bool full = true ) const;
263  void updateCaption();
264 
265  void keyPressEvent( uint key_code ); // FRAME ??
266  void updateMouseGrab();
267  Window moveResizeGrabWindow() const;
268 
269  const TQPoint calculateGravitation( bool invert, int gravity = 0 ) const; // FRAME public?
270 
271  void NETMoveResize( int x_root, int y_root, NET::Direction direction );
272  void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
273  void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
274 
275  void gotPing( Time timestamp );
276 
277  static TQCString staticWindowRole(WId);
278  static TQCString staticSessionId(WId);
279  static TQCString staticWmCommand(WId);
280  static TQCString staticWmClientMachine(WId);
281  static Window staticWmClientLeader(WId);
282 
283  void checkWorkspacePosition();
284  void updateUserTime( Time time = CurrentTime );
285  Time userTime() const;
286  bool hasUserTimeSupport() const;
287  bool ignoreFocusStealing() const;
288 
289  // does 'delete c;'
290  static void deleteClient( Client* c, allowed_t );
291 
292  static bool resourceMatch( const Client* c1, const Client* c2 );
293  static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
294  static void readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon );
295 
296  void minimize( bool avoid_animation = false );
297  void unminimize( bool avoid_animation = false );
298  void closeWindow();
299  void killWindow();
300  void maximize( MaximizeMode );
301  void toggleShade();
302  void showContextHelp();
303  void cancelShadeHover();
304  void cancelAutoRaise();
305  void destroyClient();
306  void checkActiveModal();
307  void setOpacity(bool translucent, uint opacity = 0);
308  void setShadowSize(uint shadowSize);
309  void updateOpacity();
310  void updateShadowSize();
311  bool hasCustomOpacity(){return custom_opacity;}
312  void setCustomOpacityFlag(bool custom = true);
313  bool getWindowOpacity();
314  int opacityPercentage();
315  void checkAndSetInitialRuledOpacity();
316  uint ruleOpacityInactive();
317  uint ruleOpacityActive();
318  unsigned int opacity();
319  bool isBMP();
320  void setBMP(bool b);
321  bool touches(const Client* c);
322  void setShapable(bool b);
323  bool hasStrut() const;
324 
325  private slots:
326  void autoRaise();
327  void shadeHover();
328  void shortcutActivated();
329  void updateOpacityCache();
330 
331 
332  private:
333  friend class Bridge; // FRAME
334  virtual void processMousePressEvent( TQMouseEvent* e );
335 
336  private: // TODO cleanup the order of things in the .h file
337  // use Workspace::createClient()
338  virtual ~Client(); // use destroyClient() or releaseWindow()
339 
340  Position mousePosition( const TQPoint& ) const;
341  void setCursor( Position m );
342  void setCursor( const TQCursor& c );
343 
344  void animateMinimizeOrUnminimize( bool minimize );
345  TQPixmap animationPixmap( int w );
346  // transparent stuff
347  void drawbound( const TQRect& geom );
348  void clearbound();
349  void doDrawbound( const TQRect& geom, bool clear );
350 
351  // handlers for X11 events
352  bool mapRequestEvent( XMapRequestEvent* e );
353  void unmapNotifyEvent( XUnmapEvent*e );
354  void destroyNotifyEvent( XDestroyWindowEvent*e );
355  void configureRequestEvent( XConfigureRequestEvent* e );
356  void propertyNotifyEvent( XPropertyEvent* e );
357  void clientMessageEvent( XClientMessageEvent* e );
358  void enterNotifyEvent( XCrossingEvent* e );
359  void leaveNotifyEvent( XCrossingEvent* e );
360  void focusInEvent( XFocusInEvent* e );
361  void focusOutEvent( XFocusOutEvent* e );
362 
363  bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
364  bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
365  bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root );
366 
367  // drop shadows
368  void drawIntersectingShadows();
369  void drawOverlappingShadows(bool waitForMe);
370  TQRegion getExposedRegion(TQRegion occludedRegion, int x, int y,
371  int w, int h, int thickness, int xOffset, int yOffset);
372  void imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed);
373  void imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
374  TQRegion exposed, int thickness, double maxOpacity = 0.75);
375 
376  void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
377 
378  private slots:
379  void pingTimeout();
380  void processKillerExited();
381  void demandAttentionKNotify();
382  void drawShadow();
383  void drawShadowAfter(Client *after);
384  void drawDelayedShadow();
385  void removeShadow();
386 
387  signals:
388  void shadowDrawn();
389 
390 
391  private:
392  // ICCCM 4.1.3.1, 4.1.4 , NETWM 2.5.1
393  void setMappingState( int s );
394  int mappingState() const;
395  bool isIconicState() const;
396  bool isNormalState() const;
397  bool isManaged() const; // returns false if this client is not yet managed
398  void updateAllowedActions( bool force = false );
399  TQSize sizeForClientSize( const TQSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
400  void changeMaximize( bool horizontal, bool vertical, bool adjust );
401  void checkMaximizeGeometry();
402  int checkFullScreenHack( const TQRect& geom ) const; // 0 - none, 1 - one xinerama screen, 2 - full area
403  void updateFullScreenHack( const TQRect& geom );
404  void getWmNormalHints();
405  void getMotifHints();
406  void getIcons();
407  void getWmClientLeader();
408  void getWmClientMachine();
409  void fetchName();
410  void fetchIconicName();
411  TQString readName() const;
412  void setCaption( const TQString& s, bool force = false );
413  bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
414  void finishWindowRules();
415  void setShortcutInternal( const KShortcut& cut );
416 
417  void updateWorkareaDiffs();
418  void checkDirection( int new_diff, int old_diff, TQRect& rect, const TQRect& area );
419  static int computeWorkareaDiff( int left, int right, int a_left, int a_right );
420  void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
421  NETExtendedStrut strut() const;
422  int checkShadeGeometry( int w, int h );
423  void postponeGeometryUpdates( bool postpone );
424 
425  bool startMoveResize();
426  void finishMoveResize( bool cancel );
427  void leaveMoveResize();
428  void checkUnrestrictedMoveResize();
429  void handleMoveResize( int x, int y, int x_root, int y_root );
430  void positionGeometryTip();
431  void grabButton( int mod );
432  void ungrabButton( int mod );
433  void resetMaximize();
434  void resizeDecoration( const TQSize& s );
435  void setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth);
436  void unsetDecoHashProperty();
437 
438  void pingWindow();
439  void killProcess( bool ask, Time timestamp = CurrentTime );
440  void updateUrgency();
441  static void sendClientMessage( Window w, Atom a, Atom protocol,
442  long data1 = 0, long data2 = 0, long data3 = 0 );
443 
444  void embedClient( Window w, const XWindowAttributes &attr );
445  void detectNoBorder();
446  void detectShapable();
447  void destroyDecoration();
448  void updateFrameExtents();
449 
450  void rawShow(); // just shows it
451  void rawHide(); // just hides it
452 
453  Time readUserTimeMapTimestamp( const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
454  bool session ) const;
455  Time readUserCreationTime() const;
456  static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
457  void startupIdChanged();
458 
459  Window client;
460  Window wrapper;
461  Window frame;
462  KDecoration* decoration;
463  Workspace* wspace;
464  Bridge* bridge;
465  int desk;
466  bool buttonDown;
467  bool moveResizeMode;
468  bool move_faked_activity;
469  Window move_resize_grab_window;
470  bool unrestrictedMoveResize;
471  bool isMove() const
472  {
473  return moveResizeMode && mode == PositionCenter;
474  }
475  bool isResize() const
476  {
477  return moveResizeMode && mode != PositionCenter;
478  }
479 
480  Position mode;
481  TQPoint moveOffset;
482  TQPoint invertedMoveOffset;
483  TQRect moveResizeGeom;
484  TQRect initialMoveResizeGeom;
485  XSizeHints xSizeHint;
486  void sendSyntheticConfigureNotify();
487  int mapping_state;
488  void readTransient();
489  Window verifyTransientFor( Window transient_for, bool set );
490  void addTransient( Client* cl );
491  void removeTransient( Client* cl );
492  void removeFromMainClients();
493  void cleanGrouping();
494  void checkGroupTransients();
495  void setTransient( Window new_transient_for_id );
496  Client* transient_for;
497  Window transient_for_id;
498  Window original_transient_for_id;
499  ClientList transients_list; // SELI make this ordered in stacking order?
500  ShadeMode shade_mode;
501  uint active :1;
502  uint deleting : 1; // true when doing cleanup and destroying the client
503  uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
504  uint is_shape :1;
505  uint skip_taskbar :1;
506  uint original_skip_taskbar :1; // unaffected by KWin
507  uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
508  uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
509  uint Ptakeactivity : 1; // does it support _NET_WM_TAKE_ACTIVITY
510  uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol?
511  uint Pping : 1; // does it support _NET_WM_PING?
512  uint input :1; // does the window want input in its wm_hints
513  uint skip_pager : 1;
514  uint motif_noborder : 1;
515  uint motif_may_resize : 1;
516  uint motif_may_move :1;
517  uint motif_may_close : 1;
518  uint keep_below : 1; // NET::KeepBelow
519  uint minimized : 1;
520  uint hidden : 1; // forcibly hidden by calling hide()
521  uint modal : 1; // NET::Modal
522  uint noborder : 1;
523  uint user_noborder : 1;
524  uint urgency : 1; // XWMHints, UrgencyHint
525  uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
526  uint demands_attention : 1;
527  WindowRules client_rules;
528  void getWMHints();
529  void readIcons();
530  void getWindowProtocols();
531  TQPixmap icon_pix;
532  TQPixmap miniicon_pix;
533  TQCursor cursor;
534  // FullScreenHack - non-NETWM fullscreen (noborder,size of desktop)
535  // DON'T reorder - saved to config files !!!
536  enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
537  FullScreenMode fullscreen_mode;
538  MaximizeMode max_mode;
539  TQRect geom_restore;
540  TQRect geom_fs_restore;
541  MaximizeMode maxmode_restore;
542  int workarea_diff_x, workarea_diff_y;
543  WinInfo* info;
544  TQTimer* autoRaiseTimer;
545  TQTimer* shadeHoverTimer;
546  Colormap cmap;
547  TQCString resource_name;
548  TQCString resource_class;
549  TQCString client_machine;
550  TQString cap_normal, cap_iconic, cap_suffix;
551  WId wmClientLeaderWin;
552  TQCString window_role;
553  Group* in_group;
554  Window window_group;
555  Layer in_layer;
556  TQTimer* ping_timer;
557  KProcess* process_killer;
558  Time ping_timestamp;
559  Time user_time;
560  unsigned long allowed_actions;
561  TQRect frame_geometry;
562  TQSize client_size;
563  int postpone_geometry_updates; // >0 - new geometry is remembered, but not actually set
564  bool pending_geometry_update;
565  bool shade_geometry_change;
566  int border_left, border_right, border_top, border_bottom;
567 
568  Client* shadowAfterClient;
569  TQWidget* shadowWidget;
570  TQMemArray<double> activeOpacityCache;
571  TQMemArray<double> inactiveOpacityCache;
572  TQMemArray<double>* opacityCache;
573  TQRegion shapeBoundingRegion;
574  TQTimer* shadowDelayTimer;
575  bool shadowMe;
576 
577  TQRegion _mask;
578  static bool check_active_modal; // see Client::checkActiveModal()
579  KShortcut _shortcut;
580  friend struct FetchNameInternalPredicate;
581  friend struct CheckIgnoreFocusStealingProcedure;
582  friend struct ResetupRulesProcedure;
583  friend class GeometryUpdatesPostponer;
584  void show() { assert( false ); } // SELI remove after Client is no longer TQWidget
585  void hide() { assert( false ); }
586  uint opacity_;
587  uint savedOpacity_;
588  bool custom_opacity;
589  uint rule_opacity_active; //translucency rules
590  uint rule_opacity_inactive; //dto.
591  //int shadeOriginalHeight;
592  bool isBMP_;
593  TQTimer* demandAttentionKNotifyTimer;
594 
595  friend bool performTransiencyCheck();
596  };
597 
598 // helper for Client::postponeGeometryUpdates() being called in pairs (true/false)
599 class GeometryUpdatesPostponer
600  {
601  public:
602  GeometryUpdatesPostponer( Client* c )
603  : cl( c ) { cl->postponeGeometryUpdates( true ); }
604  ~GeometryUpdatesPostponer()
605  { cl->postponeGeometryUpdates( false ); }
606  private:
607  Client* cl;
608  };
609 
610 
611 // NET WM Protocol handler class
612 class WinInfo : public NETWinInfo
613  {
614  private:
615  typedef KWinInternal::Client Client; // because of NET::Client
616  public:
617  WinInfo( Client* c, Display * display, Window window,
618  Window rwin, const unsigned long pr[], int pr_size );
619  virtual void changeDesktop(int desktop);
620  virtual void changeState( unsigned long state, unsigned long mask );
621  private:
622  Client * m_client;
623  };
624 
625 inline Window Client::window() const
626  {
627  return client;
628  }
629 
630 inline Window Client::frameId() const
631  {
632  return frame;
633  }
634 
635 inline Window Client::wrapperId() const
636  {
637  return wrapper;
638  }
639 
640 inline Window Client::decorationId() const
641  {
642  return decoration != NULL ? decoration->widget()->winId() : None;
643  }
644 
645 inline Workspace* Client::workspace() const
646  {
647  return wspace;
648  }
649 
650 inline const Client* Client::transientFor() const
651  {
652  return transient_for;
653  }
654 
655 inline Client* Client::transientFor()
656  {
657  return transient_for;
658  }
659 
660 inline bool Client::groupTransient() const
661  {
662  return transient_for_id == workspace()->rootWin();
663  }
664 
665 // needed because verifyTransientFor() may set transient_for_id to root window,
666 // if the original value has a problem (window doesn't exist, etc.)
667 inline bool Client::wasOriginallyGroupTransient() const
668  {
669  return original_transient_for_id == workspace()->rootWin();
670  }
671 
672 inline bool Client::isTransient() const
673  {
674  return transient_for_id != None;
675  }
676 
677 inline const ClientList& Client::transients() const
678  {
679  return transients_list;
680  }
681 
682 inline const Group* Client::group() const
683  {
684  return in_group;
685  }
686 
687 inline Group* Client::group()
688  {
689  return in_group;
690  }
691 
692 inline int Client::mappingState() const
693  {
694  return mapping_state;
695  }
696 
697 inline TQCString Client::resourceName() const
698  {
699  return resource_name; // it is always lowercase
700  }
701 
702 inline TQCString Client::resourceClass() const
703  {
704  return resource_class; // it is always lowercase
705  }
706 
707 inline
708 bool Client::isMinimized() const
709  {
710  return minimized;
711  }
712 
713 inline bool Client::isActive() const
714  {
715  return active;
716  }
717 
724 inline int Client::desktop() const
725  {
726  return desk;
727  }
728 
729 inline bool Client::isOnAllDesktops() const
730  {
731  return desk == NET::OnAllDesktops;
732  }
737 inline bool Client::isOnDesktop( int d ) const
738  {
739  return desk == d || /*desk == 0 ||*/ isOnAllDesktops();
740  }
741 
742 inline
743 bool Client::isShown( bool shaded_is_shown ) const
744  {
745  return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
746  }
747 
748 inline
749 bool Client::isShade() const
750  {
751  return shade_mode == ShadeNormal;
752  }
753 
754 inline
755 ShadeMode Client::shadeMode() const
756  {
757  return shade_mode;
758  }
759 
760 inline TQPixmap Client::icon() const
761  {
762  return icon_pix;
763  }
764 
765 inline TQPixmap Client::miniIcon() const
766  {
767  return miniicon_pix;
768  }
769 
770 inline TQRect Client::geometryRestore() const
771  {
772  return geom_restore;
773  }
774 
775 inline Client::MaximizeMode Client::maximizeModeRestore() const
776  {
777  return maxmode_restore;
778  }
779 
780 inline Client::MaximizeMode Client::maximizeMode() const
781  {
782  return max_mode;
783  }
784 
785 inline bool Client::skipTaskbar( bool from_outside ) const
786  {
787  return from_outside ? original_skip_taskbar : skip_taskbar;
788  }
789 
790 inline bool Client::skipPager() const
791  {
792  return skip_pager;
793  }
794 
795 inline bool Client::keepBelow() const
796  {
797  return keep_below;
798  }
799 
800 inline bool Client::shape() const
801  {
802  return is_shape;
803  }
804 
805 
806 inline bool Client::isFullScreen() const
807  {
808  return fullscreen_mode != FullScreenNone;
809  }
810 
811 inline bool Client::isModal() const
812  {
813  return modal;
814  }
815 
816 inline bool Client::hasNETSupport() const
817  {
818  return info->hasNETSupport();
819  }
820 
821 inline Colormap Client::colormap() const
822  {
823  return cmap;
824  }
825 
826 inline pid_t Client::pid() const
827  {
828  return info->pid();
829  }
830 
831 inline void Client::invalidateLayer()
832  {
833  in_layer = UnknownLayer;
834  }
835 
836 inline bool Client::isIconicState() const
837  {
838  return mapping_state == IconicState;
839  }
840 
841 inline bool Client::isNormalState() const
842  {
843  return mapping_state == NormalState;
844  }
845 
846 inline bool Client::isManaged() const
847  {
848  return mapping_state != WithdrawnState;
849  }
850 
851 inline TQCString Client::windowRole() const
852  {
853  return window_role;
854  }
855 
856 inline TQRect Client::geometry() const
857  {
858  return frame_geometry;
859  }
860 
861 inline TQSize Client::size() const
862  {
863  return frame_geometry.size();
864  }
865 
866 inline TQPoint Client::pos() const
867  {
868  return frame_geometry.topLeft();
869  }
870 
871 inline int Client::x() const
872  {
873  return frame_geometry.x();
874  }
875 
876 inline int Client::y() const
877  {
878  return frame_geometry.y();
879  }
880 
881 inline int Client::width() const
882  {
883  return frame_geometry.width();
884  }
885 
886 inline int Client::height() const
887  {
888  return frame_geometry.height();
889  }
890 
891 inline TQRect Client::rect() const
892  {
893  return TQRect( 0, 0, width(), height());
894  }
895 
896 inline TQPoint Client::clientPos() const
897  {
898  return TQPoint( border_left, border_top );
899  }
900 
901 inline TQSize Client::clientSize() const
902  {
903  return client_size;
904  }
905 
906 inline void Client::setGeometry( const TQRect& r, ForceGeometry_t force )
907  {
908  setGeometry( r.x(), r.y(), r.width(), r.height(), force );
909  }
910 
911 inline void Client::move( const TQPoint & p, ForceGeometry_t force )
912  {
913  move( p.x(), p.y(), force );
914  }
915 
916 inline void Client::plainResize( const TQSize& s, ForceGeometry_t force )
917  {
918  plainResize( s.width(), s.height(), force );
919  }
920 
921 inline bool Client::isShadowed() const
922  {
923  return shadowMe;
924  }
925 
926 inline Window Client::shadowId() const
927  {
928  return shadowWidget != NULL ? shadowWidget->winId() : None;
929  }
930 
931 inline void Client::resizeWithChecks( const TQSize& s, ForceGeometry_t force )
932  {
933  resizeWithChecks( s.width(), s.height(), force );
934  }
935 
936 inline bool Client::hasUserTimeSupport() const
937  {
938  return info->userTime() != -1U;
939  }
940 
941 inline bool Client::ignoreFocusStealing() const
942  {
943  return ignore_focus_stealing;
944  }
945 
946 inline const WindowRules* Client::rules() const
947  {
948  return &client_rules;
949  }
950 
951 KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
952 
953 inline Window Client::moveResizeGrabWindow() const
954  {
955  return move_resize_grab_window;
956  }
957 
958 inline KShortcut Client::shortcut() const
959  {
960  return _shortcut;
961  }
962 
963 inline bool Client::isBMP()
964  {
965  return isBMP_;
966  }
967 
968 inline void Client::setBMP(bool b)
969  {
970  isBMP_ = b;
971  }
972 
973 inline void Client::removeRule( Rules* rule )
974  {
975  client_rules.remove( rule );
976  }
977 
978 #ifdef NDEBUG
979 inline
980 kndbgstream& operator<<( kndbgstream& stream, const Client* ) { return stream; }
981 inline
982 kndbgstream& operator<<( kndbgstream& stream, const ClientList& ) { return stream; }
983 inline
984 kndbgstream& operator<<( kndbgstream& stream, const ConstClientList& ) { return stream; }
985 #else
986 kdbgstream& operator<<( kdbgstream& stream, const Client* );
987 kdbgstream& operator<<( kdbgstream& stream, const ClientList& );
988 kdbgstream& operator<<( kdbgstream& stream, const ConstClientList& );
989 #endif
990 
991 KWIN_COMPARE_PREDICATE( WindowMatchPredicate, Window, cl->window() == value );
992 KWIN_COMPARE_PREDICATE( FrameIdMatchPredicate, Window, cl->frameId() == value );
993 KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Window, cl->wrapperId() == value );
994 
995 } // namespace
996 
997 #endif

kwin

Skip menu "kwin"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kwin

Skip menu "kwin"
  • kate
  • kwin
  •   lib
  • libkonq
Generated for kwin by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |