1
/********************************************************************
2
KWin - the KDE window manager
3
This file is part of the KDE project.
5
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
8
This program is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2 of the License, or
11
(at your option) any later version.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program. If not, see <http://www.gnu.org/licenses/>.
20
*********************************************************************/
25
#include <config-X11.h>
32
#include <kshortcut.h>
35
#include <X11/Xutil.h>
38
#include <QScriptValue>
39
#include "scripting/client.h"
43
#include "workspace.h"
44
#include "kdecoration.h"
47
#include "clientgroup.h"
50
#include <X11/extensions/sync.h>
53
// TODO: Cleanup the order of things in this .h file
57
class KStartupInfoData;
64
typedef QPair<SWrapper::Client*, QScriptValue> ClientResolution;
71
class TabBoxClientImpl;
78
class PaintRedirector;
85
Client(Workspace* ws);
86
Window wrapperId() const;
87
Window decorationId() const;
89
const Client* transientFor() const;
90
Client* transientFor();
91
bool isTransient() const;
92
bool groupTransient() const;
93
bool wasOriginallyGroupTransient() const;
94
ClientList mainClients() const; // Call once before loop , is not indirect
95
ClientList allMainClients() const; // Call once before loop , is indirect
96
bool hasTransient(const Client* c, bool indirect) const;
97
const ClientList& transients() const; // Is not indirect
98
void checkTransient(Window w);
99
Client* findModal(bool allow_itself = false);
100
const Group* group() const;
102
void checkGroup(Group* gr = NULL, bool force = false);
103
void changeClientLeaderGroup(Group* gr);
104
const WindowRules* rules() const;
105
void removeRule(Rules* r);
106
void setupWindowRules(bool ignore_temporary);
107
void applyWindowRules();
108
void updateWindowRules();
109
void updateFullscreenMonitors(NETFullscreenMonitors topology);
112
* Returns true for "special" windows and false for windows which are "normal"
113
* (normal=window which has a border, can be moved by the user, can be closed, etc.)
114
* true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
115
* false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
117
bool isSpecialWindow() const;
118
bool hasNETSupport() const;
121
* This is a public object with no wrappers or anything to keep it fast,
122
* so in essence, direct access is allowed. Please be very careful while
125
QHash<QScriptEngine*, ClientResolution>* scriptCache;
127
QSize minSize() const;
128
QSize maxSize() const;
129
virtual QPoint clientPos() const; // Inside of geometry()
130
virtual QSize clientSize() const;
131
virtual QRect visibleRect() const;
133
bool windowEvent(XEvent* e);
134
virtual bool eventFilter(QObject* o, QEvent* e);
136
void syncEvent(XSyncAlarmNotifyEvent* e);
139
bool manage(Window w, bool isMapped);
140
void releaseWindow(bool on_shutdown = false);
141
void destroyClient();
143
/// How to resize the window in order to obey constains (mainly aspect ratios)
146
SizemodeFixedW, ///< Try not to affect width
147
SizemodeFixedH, ///< Try not to affect height
148
SizemodeMax ///< Try not to make it larger in either direction
150
QSize adjustedSize(const QSize&, Sizemode mode = SizemodeAny) const;
151
QSize adjustedSize() const;
153
QPixmap icon() const;
154
QPixmap icon(const QSize& size) const;
155
QPixmap miniIcon() const;
156
QPixmap bigIcon() const;
157
QPixmap hugeIcon() const;
159
bool isActive() const;
160
void setActive(bool);
162
virtual int desktop() const;
163
void setDesktop(int);
164
void setOnAllDesktops(bool set);
166
virtual QStringList activities() const;
167
void setOnActivity(const QString &activity, bool enable);
168
void setOnAllActivities(bool set);
169
void setOnActivities(QStringList newActivitiesList);
170
void updateActivities(bool includeTransients);
172
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
173
bool isShown(bool shaded_is_shown) const;
174
bool isHiddenInternal() const; // For compositing
176
bool isShade() const; // True only for ShadeNormal
177
ShadeMode shadeMode() const; // Prefer isShade()
178
void setShade(ShadeMode mode);
179
bool isShadeable() const;
181
bool isMinimized() const;
182
bool isMaximizable() const;
183
QRect geometryRestore() const;
184
MaximizeMode maximizeModeRestore() const;
185
MaximizeMode maximizeMode() const;
186
bool isMinimizable() const;
187
void setMaximize(bool vertically, bool horizontally);
188
QRect iconGeometry() const;
190
void setFullScreen(bool set, bool user);
191
bool isFullScreen() const;
192
bool isFullScreenable(bool fullscreen_hack = false) const;
193
bool isActiveFullScreen() const;
194
bool userCanSetFullScreen() const;
195
QRect geometryFSRestore() const {
196
return geom_fs_restore; // Only for session saving
198
int fullScreenMode() const {
199
return fullscreen_mode; // only for session saving
202
bool noBorder() const;
203
void setNoBorder(bool set);
204
bool userCanSetNoBorder() const;
205
void checkNoBorder();
207
bool skipTaskbar(bool from_outside = false) const;
208
void setSkipTaskbar(bool set, bool from_outside);
210
bool skipPager() const;
211
void setSkipPager(bool);
213
bool skipSwitcher() const;
214
void setSkipSwitcher(bool set);
216
bool keepAbove() const;
217
void setKeepAbove(bool);
218
bool keepBelow() const;
219
void setKeepBelow(bool);
221
Layer belongsToLayer() const;
222
void invalidateLayer();
223
int sessionStackingOrder() const;
225
void setModal(bool modal);
226
bool isModal() const;
228
// Auxiliary functions, depend on the windowType
229
bool wantsTabFocus() const;
230
bool wantsInput() const;
232
bool isResizable() const;
233
bool isMovable() const;
234
bool isMovableAcrossScreens() const;
235
bool isCloseable() const; ///< May be closed by the user (May have a close button)
237
void takeActivity(int flags, bool handled, allowed_t); // Takes ActivityFlags as arg (in utils.h)
238
void takeFocus(allowed_t);
239
void demandAttention(bool set = true);
241
void setMask(const QRegion& r, int mode = X::Unsorted);
242
QRegion mask() const;
244
void updateDecoration(bool check_workspace_pos, bool force = false);
245
bool checkBorderSizes(bool also_resize);
246
void triggerDecorationRepaint();
250
void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet, bool emitJs = true);
251
void setGeometry(const QRect& r, ForceGeometry_t force = NormalGeometrySet, bool emitJs = true);
252
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet);
253
void move(const QPoint& p, ForceGeometry_t force = NormalGeometrySet);
254
/// plainResize() simply resizes
255
void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet, bool emitJs = true);
256
void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet, bool emitJs = true);
257
/// resizeWithChecks() resizes according to gravity, and checks workarea position
258
void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet);
259
void resizeWithChecks(const QSize& s, ForceGeometry_t force = NormalGeometrySet);
260
void keepInArea(QRect area, bool partial = false);
261
void setElectricBorderMode(QuickTileMode mode);
262
QuickTileMode electricBorderMode() const;
263
void setElectricBorderMaximizing(bool maximizing);
264
bool isElectricBorderMaximizing() const;
265
QRect electricBorderMaximizeGeometry(QPoint pos, int desktop);
266
QSize sizeForClientSize(const QSize&, Sizemode mode = SizemodeAny, bool noframe = false) const;
268
/** Set the quick tile mode ("snap") of this window.
269
* This will also handle preserving and restoring of window geometry as necessary.
270
* @param mode The tile mode (left/right) to give this window.
272
void setQuickTileMode(QuickTileMode mode, bool keyboard = false);
274
void growHorizontal();
275
void shrinkHorizontal();
277
void shrinkVertical();
279
bool providesContextHelp() const;
280
KShortcut shortcut() const;
281
void setShortcut(const QString& cut);
283
WindowOperation mouseButtonToWindowOperation(Qt::MouseButtons button);
284
bool performMouseCommand(Options::MouseCommand, const QPoint& globalPos, bool handled = false);
286
QRect adjustedClientArea(const QRect& desktop, const QRect& area) const;
288
Colormap colormap() const;
290
/// Updates visibility depending on being shaded, virtual desktop, etc.
291
void updateVisibility();
292
/// Hides a client - Basically like minimize, but without effects, it's simply hidden
293
void hideClient(bool hide);
294
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
296
virtual void setupCompositing();
297
virtual void finishCompositing();
298
inline bool isBlockingCompositing() { return blocks_compositing; }
299
void updateCompositeBlocking(bool readProperty = false);
301
QString caption(bool full = true) const;
302
void updateCaption();
304
void keyPressEvent(uint key_code); // FRAME ??
305
void updateMouseGrab();
306
Window moveResizeGrabWindow() const;
308
const QPoint calculateGravitation(bool invert, int gravity = 0) const; // FRAME public?
310
void NETMoveResize(int x_root, int y_root, NET::Direction direction);
311
void NETMoveResizeWindow(int flags, int x, int y, int width, int height);
312
void restackWindow(Window above, int detail, NET::RequestSource source, Time timestamp,
313
bool send_event = false);
315
void gotPing(Time timestamp);
317
void checkWorkspacePosition();
318
void updateUserTime(Time time = CurrentTime);
319
Time userTime() const;
320
bool hasUserTimeSupport() const;
321
bool ignoreFocusStealing() const;
324
static void deleteClient(Client* c, allowed_t);
326
static bool belongToSameApplication(const Client* c1, const Client* c2, bool active_hack = false);
327
static bool sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool active_hack);
328
static void readIcons(Window win, QPixmap* icon, QPixmap* miniicon, QPixmap* bigicon, QPixmap* hugeicon);
330
void minimize(bool avoid_animation = false);
331
void unminimize(bool avoid_animation = false);
334
void maximize(MaximizeMode);
336
void showContextHelp();
337
void cancelShadeHoverTimer();
338
void cancelAutoRaise();
339
void checkActiveModal();
340
StrutRect strutRect(StrutArea area) const;
341
StrutRects strutRects() const;
342
bool hasStrut() const;
345
ClientGroup* clientGroup() const; // Returns a pointer to client_group
346
void setClientGroup(ClientGroup* group);
348
* If shown is true the client is mapped and raised, if false
349
* the client is unmapped and hidden, this function is called
350
* when the tabbing group of the client switches its visible
353
void setClientShown(bool shown);
355
* When a click is done in the decoration and it calls the group
356
* to change the visible client it starts to move-resize the new
357
* client, this function stops it.
359
void dontMoveResize();
362
* Whether or not the window has a strut that expands through the invisible area of
363
* an xinerama setup where the monitors are not the same resolution.
365
bool hasOffscreenXineramaStrut() const;
367
bool isMove() const {
368
return moveResizeMode && mode == PositionCenter;
370
bool isResize() const {
371
return moveResizeMode && mode != PositionCenter;
374
// Decorations <-> Effects
375
const QPixmap *topDecoPixmap() const {
376
return &decorationPixmapTop;
378
const QPixmap *leftDecoPixmap() const {
379
return &decorationPixmapLeft;
381
const QPixmap *bottomDecoPixmap() const {
382
return &decorationPixmapBottom;
384
const QPixmap *rightDecoPixmap() const {
385
return &decorationPixmapRight;
388
int paddingLeft() const {
391
int paddingRight() const {
392
return padding_right;
394
int paddingTop() const {
397
int paddingBottom() const {
398
return padding_bottom;
401
bool decorationPixmapRequiresRepaint();
402
void ensureDecorationPixmapsPainted();
404
QRect decorationRect() const;
406
QRect transparentRect() const;
408
QRegion decorationPendingRegion() const;
410
enum CoordinateMode {
411
DecorationRelative, // Relative to the top left corner of the decoration
412
WindowRelative // Relative to the top left corner of the window
414
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom, CoordinateMode mode) const;
415
virtual void addRepaintFull();
417
TabBox::TabBoxClientImpl* tabBoxClient() const {
418
return m_tabBoxClient;
421
//sets whether the client should be treated as a SessionInteract window
422
void setSessionInteract(bool needed);
428
void shortcutActivated();
429
void delayedMoveResize();
432
friend class Bridge; // FRAME
433
virtual void processMousePressEvent(QMouseEvent* e);
436
// Use Workspace::createClient()
437
virtual ~Client(); ///< Use destroyClient() or releaseWindow()
439
Position mousePosition(const QPoint&) const;
443
void drawbound(const QRect& geom);
445
void doDrawbound(const QRect& geom, bool clear);
447
// Handlers for X11 events
448
bool mapRequestEvent(XMapRequestEvent* e);
449
void unmapNotifyEvent(XUnmapEvent* e);
450
void destroyNotifyEvent(XDestroyWindowEvent* e);
451
void configureRequestEvent(XConfigureRequestEvent* e);
452
virtual void propertyNotifyEvent(XPropertyEvent* e);
453
void clientMessageEvent(XClientMessageEvent* e);
454
void enterNotifyEvent(XCrossingEvent* e);
455
void leaveNotifyEvent(XCrossingEvent* e);
456
void focusInEvent(XFocusInEvent* e);
457
void focusOutEvent(XFocusOutEvent* e);
459
virtual void damageNotifyEvent(XDamageNotifyEvent* e);
462
bool buttonPressEvent(Window w, int button, int state, int x, int y, int x_root, int y_root);
463
bool buttonReleaseEvent(Window w, int button, int state, int x, int y, int x_root, int y_root);
464
bool motionNotifyEvent(Window w, int state, int x, int y, int x_root, int y_root);
465
void checkQuickTilingMaximizationZones(int xroot, int yroot);
467
bool processDecorationButtonPress(int button, int state, int x, int y, int x_root, int y_root,
468
bool ignoreMenu = false);
471
virtual void debug(QDebug& stream) const;
472
virtual bool shouldUnredirect() const;
476
void processKillerExited();
477
void demandAttentionKNotify();
479
void delayedSetShortcut();
480
void repaintDecorationPending();
482
//Signals for the scripting interface
483
//Signals make an excellent way for communication
484
//in between objects as compared to simple function
487
void s_clientMoved();
488
void clientManaging(KWin::Client*);
490
void s_unminimized();
491
void maximizeSet(QPair<bool, bool>);
493
void s_fullScreenSet(bool, bool);
494
void clientClosed(KWin::Client*);
495
void clientMaximizedStateChanged(KWin::Client*, KDecorationDefines::MaximizeMode);
496
void clientMinimized(KWin::Client* client, bool animate);
497
void clientUnminimized(KWin::Client* client, bool animate);
498
void clientGeometryShapeChanged(KWin::Client* client, const QRect& old);
499
void clientStartUserMovedResized(KWin::Client*);
500
void clientStepUserMovedResized(KWin::Client *, const QRect&);
501
void clientFinishUserMovedResized(KWin::Client*);
503
// To make workspace-client calls, a few slots are also
509
void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1
510
bool isManaged() const; ///< Returns false if this client is not yet managed
511
void updateAllowedActions(bool force = false);
512
QRect fullscreenMonitorsArea(NETFullscreenMonitors topology) const;
513
void changeMaximize(bool horizontal, bool vertical, bool adjust);
514
int checkFullScreenHack(const QRect& geom) const; // 0 - None, 1 - One xinerama screen, 2 - Full area
515
void updateFullScreenHack(const QRect& geom);
516
void getWmNormalHints();
517
void getMotifHints();
520
void fetchIconicName();
521
QString readName() const;
522
void setCaption(const QString& s, bool force = false);
523
bool hasTransientInternal(const Client* c, bool indirect, ConstClientList& set) const;
524
void finishWindowRules();
525
void setShortcutInternal(const KShortcut& cut);
527
void checkDirection(int new_diff, int old_diff, QRect& rect, const QRect& area);
528
void configureRequest(int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool);
529
NETExtendedStrut strut() const;
530
int checkShadeGeometry(int w, int h);
531
void blockGeometryUpdates(bool block);
532
void getSyncCounter();
533
void sendSyncRequest();
535
bool startMoveResize();
536
void finishMoveResize(bool cancel);
537
void leaveMoveResize();
538
void checkUnrestrictedMoveResize();
539
void handleMoveResize(int x, int y, int x_root, int y_root);
540
void startDelayedMoveResize();
541
void stopDelayedMoveResize();
542
void positionGeometryTip();
543
void grabButton(int mod);
544
void ungrabButton(int mod);
545
void resetMaximize();
546
void resizeDecoration(const QSize& s);
547
void performMoveResize();
550
void killProcess(bool ask, Time timestamp = CurrentTime);
551
void updateUrgency();
552
static void sendClientMessage(Window w, Atom a, Atom protocol,
553
long data1 = 0, long data2 = 0, long data3 = 0);
555
void embedClient(Window w, const XWindowAttributes& attr);
556
void detectNoBorder();
557
void destroyDecoration();
558
void updateFrameExtents();
560
void internalShow(allowed_t);
561
void internalHide(allowed_t);
562
void internalKeep(allowed_t);
564
void unmap(allowed_t);
565
void updateHiddenPreview();
567
void updateInputShape();
568
void repaintDecorationPixmap(QPixmap& pix, const QRect& r, const QPixmap& src, QRegion reg);
569
void resizeDecorationPixmaps();
571
Time readUserTimeMapTimestamp(const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
573
Time readUserCreationTime() const;
574
void startupIdChanged();
578
KDecoration* decoration;
581
QStringList activityList;
584
bool move_faked_activity;
585
Window move_resize_grab_window;
586
bool move_resize_has_keyboard_grab;
587
bool unrestrictedMoveResize;
591
QPoint invertedMoveOffset;
592
QRect moveResizeGeom;
593
QRect initialMoveResizeGeom;
594
XSizeHints xSizeHint;
595
void sendSyntheticConfigureNotify();
597
Withdrawn, ///< Not handled, as per ICCCM WithdrawnState
598
Mapped, ///< The frame is mapped
599
Unmapped, ///< The frame is not mapped
600
Kept ///< The frame should be unmapped, but is kept (For compositing)
602
MappingState mapping_state;
604
/** The quick tile mode of this window.
609
void readTransient();
610
Window verifyTransientFor(Window transient_for, bool set);
611
void addTransient(Client* cl);
612
void removeTransient(Client* cl);
613
void removeFromMainClients();
614
void cleanGrouping();
615
void checkGroupTransients();
616
void setTransient(Window new_transient_for_id);
617
Client* transient_for;
618
Window transient_for_id;
619
Window original_transient_for_id;
620
ClientList transients_list; // SELI TODO: Make this ordered in stacking order?
621
ShadeMode shade_mode;
623
uint deleting : 1; ///< True when doing cleanup and destroying the client
624
uint keep_above : 1; ///< NET::KeepAbove (was stays_on_top)
625
uint skip_taskbar : 1;
626
uint original_skip_taskbar : 1; ///< Unaffected by KWin
627
uint Pdeletewindow : 1; ///< Does the window understand the DeleteWindow protocol?
628
uint Ptakefocus : 1;///< Does the window understand the TakeFocus protocol?
629
uint Ptakeactivity : 1; ///< Does it support _NET_WM_TAKE_ACTIVITY
630
uint Pcontexthelp : 1; ///< Does the window understand the ContextHelp protocol?
631
uint Pping : 1; ///< Does it support _NET_WM_PING?
632
uint input : 1; ///< Does the window want input in its wm_hints
634
uint skip_switcher : 1;
635
uint motif_may_resize : 1;
636
uint motif_may_move : 1;
637
uint motif_may_close : 1;
638
uint keep_below : 1; ///< NET::KeepBelow
640
uint hidden : 1; ///< Forcibly hidden by calling hide()
641
uint modal : 1; ///< NET::Modal
643
uint app_noborder : 1; ///< App requested no border via window type, shape extension, etc.
644
uint motif_noborder : 1; ///< App requested no border via Motif WM hints
645
uint urgency : 1; ///< XWMHints, UrgencyHint
646
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
647
uint demands_attention : 1;
648
bool blocks_compositing;
649
WindowRules client_rules;
652
void getWindowProtocols();
654
QPixmap miniicon_pix;
656
QPixmap hugeicon_pix;
658
// DON'T reorder - Saved to config files !!!
659
enum FullScreenMode {
662
FullScreenHack ///< Non-NETWM fullscreen (noborder and size of desktop)
664
FullScreenMode fullscreen_mode;
665
MaximizeMode max_mode;
667
QRect geom_fs_restore;
668
MaximizeMode maxmode_restore;
669
QTimer* autoRaiseTimer;
670
QTimer* shadeHoverTimer;
671
QTimer* delayedMoveResizeTimer;
673
QString cap_normal, cap_iconic, cap_suffix;
676
ClientGroup* client_group;
679
QProcess* process_killer;
682
unsigned long allowed_actions;
684
int block_geometry_updates; // > 0 = New geometry is remembered, but not actually set
685
enum PendingGeometry_t {
687
PendingGeometryNormal,
688
PendingGeometryForced
690
PendingGeometry_t pending_geometry_update;
691
QRect geom_before_block;
692
QRect deco_rect_before_block;
693
bool shade_geometry_change;
695
XSyncCounter sync_counter;
696
XSyncValue sync_counter_value;
697
XSyncAlarm sync_alarm;
699
QTimer* sync_timeout;
700
bool sync_resize_pending;
701
int border_left, border_right, border_top, border_bottom;
702
int padding_left, padding_right, padding_top, padding_bottom;
704
static bool check_active_modal; ///< \see Client::checkActiveModal()
706
int sm_stacking_order;
707
friend struct FetchNameInternalPredicate;
708
friend struct CheckIgnoreFocusStealingProcedure;
709
friend struct ResetupRulesProcedure;
710
friend class GeometryUpdatesBlocker;
711
QTimer* demandAttentionKNotifyTimer;
712
QPixmap decorationPixmapLeft, decorationPixmapRight, decorationPixmapTop, decorationPixmapBottom;
713
// we (instead of Qt) initialize the Pixmaps, and have to free them
714
bool m_responsibleForDecoPixmap;
715
PaintRedirector* paintRedirector;
716
TabBox::TabBoxClientImpl* m_tabBoxClient;
718
bool electricMaximizing;
719
QuickTileMode electricMode;
721
friend bool performTransiencyCheck();
722
friend class SWrapper::Client;
724
void checkActivities();
725
bool activitiesDefined; //whether the x property was actually set
727
bool needsSessionInteract;
731
* Helper for Client::blockGeometryUpdates() being called in pairs (true/false)
733
class GeometryUpdatesBlocker
736
GeometryUpdatesBlocker(Client* c)
738
cl->blockGeometryUpdates(true);
740
~GeometryUpdatesBlocker() {
741
cl->blockGeometryUpdates(false);
749
* NET WM Protocol handler class
751
class WinInfo : public NETWinInfo2
754
typedef KWin::Client Client; // Because of NET::Client
757
WinInfo(Client* c, Display * display, Window window,
758
Window rwin, const unsigned long pr[], int pr_size);
759
virtual void changeDesktop(int desktop);
760
virtual void changeFullscreenMonitors(NETFullscreenMonitors topology);
761
virtual void changeState(unsigned long state, unsigned long mask);
768
inline Window Client::wrapperId() const
773
inline Window Client::decorationId() const
775
return decoration != NULL ? decoration->widget()->winId() : None;
778
inline const Client* Client::transientFor() const
780
return transient_for;
783
inline Client* Client::transientFor()
785
return transient_for;
788
inline bool Client::groupTransient() const
790
return transient_for_id == rootWindow();
793
// Needed because verifyTransientFor() may set transient_for_id to root window,
794
// if the original value has a problem (window doesn't exist, etc.)
795
inline bool Client::wasOriginallyGroupTransient() const
797
return original_transient_for_id == rootWindow();
800
inline bool Client::isTransient() const
802
return transient_for_id != None;
805
inline const ClientList& Client::transients() const
807
return transients_list;
810
inline const Group* Client::group() const
815
inline Group* Client::group()
820
inline void Client::setClientGroup(ClientGroup* group)
822
client_group = group;
825
inline ClientGroup* Client::clientGroup() const
830
inline bool Client::isMinimized() const
835
inline bool Client::isActive() const
840
inline bool Client::isShown(bool shaded_is_shown) const
842
return !isMinimized() && (!isShade() || shaded_is_shown) && !hidden &&
843
(clientGroup() == NULL || clientGroup()->visible() == this);
846
inline bool Client::isHiddenInternal() const
851
inline bool Client::isShade() const
853
return shade_mode == ShadeNormal;
856
inline ShadeMode Client::shadeMode() const
861
inline QPixmap Client::icon() const
866
inline QPixmap Client::miniIcon() const
871
inline QPixmap Client::bigIcon() const
876
inline QPixmap Client::hugeIcon() const
881
inline QRect Client::geometryRestore() const
886
inline Client::MaximizeMode Client::maximizeModeRestore() const
888
return maxmode_restore;
891
inline Client::MaximizeMode Client::maximizeMode() const
896
inline bool Client::skipTaskbar(bool from_outside) const
898
return from_outside ? original_skip_taskbar : skip_taskbar;
901
inline bool Client::skipPager() const
906
inline bool Client::skipSwitcher() const
908
return skip_switcher;
911
inline bool Client::keepAbove() const
916
inline bool Client::keepBelow() const
921
inline bool Client::isFullScreen() const
923
return fullscreen_mode != FullScreenNone;
926
inline bool Client::isModal() const
931
inline bool Client::hasNETSupport() const
933
return info->hasNETSupport();
936
inline Colormap Client::colormap() const
941
inline void Client::invalidateLayer()
943
in_layer = UnknownLayer;
946
inline int Client::sessionStackingOrder() const
948
return sm_stacking_order;
951
inline bool Client::isManaged() const
953
return mapping_state != Withdrawn;
956
inline QPoint Client::clientPos() const
958
return QPoint(border_left, border_top);
961
inline QSize Client::clientSize() const
966
inline QRect Client::visibleRect() const
968
return Toplevel::visibleRect().adjusted(-padding_left, -padding_top, padding_right, padding_bottom);
971
inline void Client::setGeometry(const QRect& r, ForceGeometry_t force, bool emitJs)
973
setGeometry(r.x(), r.y(), r.width(), r.height(), force, emitJs);
976
inline void Client::move(const QPoint& p, ForceGeometry_t force)
978
move(p.x(), p.y(), force);
981
inline void Client::plainResize(const QSize& s, ForceGeometry_t force, bool emitJs)
983
plainResize(s.width(), s.height(), force, emitJs);
986
inline void Client::resizeWithChecks(const QSize& s, ForceGeometry_t force)
988
resizeWithChecks(s.width(), s.height(), force);
991
inline bool Client::hasUserTimeSupport() const
993
return info->userTime() != -1U;
996
inline bool Client::ignoreFocusStealing() const
998
return ignore_focus_stealing;
1001
inline const WindowRules* Client::rules() const
1003
return &client_rules;
1006
KWIN_PROCEDURE(CheckIgnoreFocusStealingProcedure, Client, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing(cl));
1008
inline Window Client::moveResizeGrabWindow() const
1010
return move_resize_grab_window;
1013
inline KShortcut Client::shortcut() const
1018
inline void Client::removeRule(Rules* rule)
1020
client_rules.remove(rule);
1023
inline bool Client::hiddenPreview() const
1025
return mapping_state == Kept;
1028
KWIN_COMPARE_PREDICATE(WrapperIdMatchPredicate, Client, Window, cl->wrapperId() == value);