46class Client :
public TQObject,
public KDecorationDefines
51 Window window()
const;
52 Window frameId()
const;
53 Window wrapperId()
const;
54 Window decorationId()
const;
56 Workspace* workspace()
const;
57 const Client* transientFor()
const;
59 bool isTransient()
const;
60 bool isModalSystemNotification()
const;
61 bool groupTransient()
const;
62 bool wasOriginallyGroupTransient()
const;
63 ClientList mainClients()
const;
64 bool hasTransient(
const Client* c,
bool indirect )
const;
65 const ClientList& transients()
const;
66 void checkTransient( Window w );
68 const Group* group()
const;
70 void checkGroup( Group* gr = NULL,
bool force =
false );
71 void changeClientLeaderGroup( Group* gr );
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();
80 TQRect geometry()
const;
82 TQSize minSize()
const;
83 TQSize maxSize()
const;
90 TQPoint clientPos()
const;
91 TQSize clientSize()
const;
94 virtual bool eventFilter( TQObject* o, TQEvent* e );
96 bool manage( Window w,
bool isMapped );
107 TQSize
adjustedSize(
const TQSize&, Sizemode mode = SizemodeAny )
const;
108 TQSize adjustedSize()
const;
110 TQPixmap icon()
const;
111 TQPixmap miniIcon()
const;
113 bool isActive()
const;
114 void setActive(
bool,
bool updateOpacity =
true );
116 bool isSuspendable()
const;
117 bool isResumeable()
const;
120 void setDesktop(
int );
122 bool isOnCurrentDesktop()
const;
123 bool isOnAllDesktops()
const;
124 void setOnAllDesktops(
bool set );
126 bool isOnScreen(
int screen )
const;
130 bool isShown(
bool shaded_is_shown )
const;
132 bool isShade()
const;
133 ShadeMode shadeMode()
const;
134 void setShade( ShadeMode mode );
135 bool isShadeable()
const;
137 bool isMinimized()
const;
138 bool isMaximizable()
const;
139 TQRect geometryRestore()
const;
140 MaximizeMode maximizeModeRestore()
const;
141 MaximizeMode maximizeMode()
const;
143 void setMaximize(
bool vertically,
bool horizontally );
145 void setFullScreen(
bool set,
bool user );
146 bool isFullScreen()
const;
147 bool isFullScreenable(
bool fullscreen_hack =
false )
const;
148 bool userCanSetFullScreen()
const;
149 TQRect geometryFSRestore()
const {
return geom_fs_restore; }
150 int fullScreenMode()
const {
return fullscreen_mode; }
152 bool isUserNoBorder()
const;
153 void setUserNoBorder(
bool set );
154 void setUserNoBorder(
bool set,
bool force );
155 bool userCanSetNoBorder()
const;
156 bool isUserNoBorderForced()
const;
157 bool noBorder()
const;
159 bool skipTaskbar(
bool from_outside =
false )
const;
160 void setSkipTaskbar(
bool set,
bool from_outside );
162 bool skipPager()
const;
163 void setSkipPager(
bool );
166 void setKeepAbove(
bool );
167 bool keepBelow()
const;
168 void setKeepBelow(
bool );
170 Layer belongsToLayer()
const;
171 void invalidateLayer();
173 void setModal(
bool modal );
174 bool isModal()
const;
177 bool wantsTabFocus()
const;
178 bool wantsInput()
const;
179 bool hasNETSupport()
const;
181 bool isDesktop()
const;
183 bool isToolbar()
const;
184 bool isTopMenu()
const;
186 bool isNormalWindow()
const;
187 bool isDialog()
const;
188 bool isSplash()
const;
189 bool isUtility()
const;
194 bool isSpecialWindow()
const;
197 bool isCloseable()
const;
199 void takeActivity(
int flags,
bool handled, allowed_t );
200 void takeFocus( allowed_t );
201 void demandAttention(
bool set =
true );
203 void setMask(
const TQRegion& r,
int mode = X::Unsorted );
204 TQRegion mask()
const;
206 void updateDecoration(
bool check_workspace_pos,
bool force =
false );
207 void checkBorderSizes();
210 bool isShadowed()
const;
211 void setShadowed(
bool shadowed);
212 Window shadowId()
const;
216 friend void Workspace::raiseClient(
Client *);
220 friend void Workspace::updateOverlappingShadows(WId);
226 void setGeometry(
int x,
int y,
int w,
int h, ForceGeometry_t force = NormalGeometrySet );
227 void setGeometry(
const TQRect& r, ForceGeometry_t force = NormalGeometrySet );
228 void move(
int x,
int y, ForceGeometry_t force = NormalGeometrySet );
229 void move(
const TQPoint & p, ForceGeometry_t force = NormalGeometrySet );
231 void plainResize(
int w,
int h, ForceGeometry_t force = NormalGeometrySet );
232 void plainResize(
const TQSize& s, ForceGeometry_t force = NormalGeometrySet );
234 void resizeWithChecks(
int w,
int h, ForceGeometry_t force = NormalGeometrySet );
235 void resizeWithChecks(
const TQSize& s, ForceGeometry_t force = NormalGeometrySet );
236 void keepInArea( TQRect area,
bool partial =
false );
237 void setActiveBorderMode( ActiveMaximizingMode mode );
238 void setActiveBorderPos( TQPoint pos );
239 void setActiveBorder( ActiveBorder border);
240 ActiveMaximizingMode activeBorderMode()
const;
241 TQPoint activeBorderPos()
const;
242 ActiveBorder activeBorder()
const;
243 void setActiveBorderMaximizing(
bool maximizing);
244 void cancelActiveBorderMaximizing();
245 bool isActiveBorderMaximizing()
const;
246 TQRect activeBorderMaximizeGeometry();
247 void tileToBorder(ActiveBorder border);
249 void growHorizontal();
250 void shrinkHorizontal();
252 void shrinkVertical();
255 TDEShortcut shortcut()
const;
256 void setShortcut(
const TQString& cut );
258 bool performMouseCommand( Options::MouseCommand, TQPoint globalPos,
bool handled =
false );
260 TQCString windowRole()
const;
262 TQCString resourceName()
const;
263 TQCString resourceClass()
const;
271 Colormap colormap()
const;
274 void updateVisibility();
276 void hideClient(
bool hide );
278 TQString
caption(
bool full =
true )
const;
279 void updateCaption();
281 void keyPressEvent( uint key_code );
282 void updateMouseGrab();
283 Window moveResizeGrabWindow()
const;
285 const TQPoint calculateGravitation(
bool invert,
int gravity = 0 )
const;
287 void NETMoveResize(
int x_root,
int y_root, NET::Direction direction );
288 void NETMoveResizeWindow(
int flags,
int x,
int y,
int width,
int height );
289 void restackWindow( Window above,
int detail, NET::RequestSource source, Time timestamp,
bool send_event =
false );
291 void gotPing( Time timestamp );
296 static TQCString staticWmClientMachine(WId);
299 void checkWorkspacePosition();
301 Time userTime()
const;
302 bool hasUserTimeSupport()
const;
303 bool ignoreFocusStealing()
const;
306 static void deleteClient(
Client* c, allowed_t );
308 static bool resourceMatch(
const Client* c1,
const Client* c2 );
309 static bool belongToSameApplication(
const Client* c1,
const Client* c2,
bool active_hack =
false );
310 static void readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon );
312 void minimize(
bool avoid_animation =
false );
313 void unminimize(
bool avoid_animation =
false );
316 void suspendWindow();
318 bool queryUserSuspendedResume();
319 void maximize( MaximizeMode );
322 void cancelShadeHover();
323 void cancelAutoRaise();
324 void destroyClient();
325 void checkActiveModal();
328 struct Opacity { enum : uint {
330 MouseStep = 0xCCCCCCC,
334 void setOpacity(uint opacity);
335 void setShadowSize(uint shadowSize);
336 uint defaultOpacity();
338 uint defaultOpacity(
bool active);
339 void updateOpacity();
340 void updateShadowSize();
341 bool hasCustomOpacity(){
return custom_opacity;}
342 void setCustomOpacityFlag(
bool custom =
true);
343 bool getWindowOpacity();
344 int opacityPercentage();
345 void checkAndSetInitialRuledOpacity();
346 uint ruleOpacityInactive();
347 uint ruleOpacityActive();
348 unsigned int opacity();
351 bool touches(
const Client* c);
352 void setShapable(
bool b);
353 bool hasStrut()
const;
358 void configureRequestTimeout();
359 void shortcutActivated();
360 void updateOpacityCache();
365 virtual void processMousePressEvent( TQMouseEvent* e );
371 Position mousePosition(
const TQPoint& )
const;
372 void setCursor( Position m );
373 void setCursor(
const TQCursor& c );
375 void animateMinimizeOrUnminimize(
bool minimize );
376 TQPixmap animationPixmap(
int w );
378 void drawbound(
const TQRect& geom );
380 void doDrawbound(
const TQRect& geom,
bool clear );
383 bool mapRequestEvent( XMapRequestEvent* e );
384 void unmapNotifyEvent( XUnmapEvent*e );
385 void destroyNotifyEvent( XDestroyWindowEvent*e );
386 void configureRequestEvent( XConfigureRequestEvent* e );
387 void propertyNotifyEvent( XPropertyEvent* e );
388 void clientMessageEvent( XClientMessageEvent* e );
389 void enterNotifyEvent( XCrossingEvent* e );
390 void leaveNotifyEvent( XCrossingEvent* e );
391 void focusInEvent( XFocusInEvent* e );
392 void focusOutEvent( XFocusOutEvent* e );
394 bool buttonPressEvent( Window w,
int button,
int state,
int x,
int y,
int x_root,
int y_root );
395 bool buttonReleaseEvent( Window w,
int button,
int state,
int x,
int y,
int x_root,
int y_root );
396 bool motionNotifyEvent( Window w,
int state,
int x,
int y,
int x_root,
int y_root );
399 void drawIntersectingShadows();
400 void drawOverlappingShadows(
bool waitForMe);
401 TQRegion getExposedRegion(TQRegion occludedRegion,
int x,
int y,
402 int w,
int h,
int thickness,
int xOffset,
int yOffset);
403 void imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed);
404 void imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
405 TQRegion exposed,
int thickness,
double maxOpacity = 0.75);
407 void processDecorationButtonPress(
int button,
int state,
int x,
int y,
int x_root,
int y_root );
411 void processKillerExited();
412 void processResumerExited();
413 void demandAttentionKNotify();
415 void drawShadowAfter(
Client *after);
416 void drawDelayedShadow();
425 void setMappingState(
int s );
426 int mappingState()
const;
427 bool isIconicState()
const;
428 bool isNormalState()
const;
429 bool isManaged()
const;
430 void updateAllowedActions(
bool force =
false );
431 TQSize sizeForClientSize(
const TQSize&, Sizemode mode = SizemodeAny,
bool noframe =
false )
const;
432 void changeMaximize(
bool horizontal,
bool vertical,
bool adjust );
433 void checkMaximizeGeometry();
434 int checkFullScreenHack(
const TQRect& geom )
const;
435 void updateFullScreenHack(
const TQRect& geom );
436 void getWmNormalHints();
437 void getMotifHints();
439 void getWmClientLeader();
440 void getWmClientMachine();
442 void fetchIconicName();
443 TQString readName()
const;
444 void setCaption(
const TQString& s,
bool force =
false );
445 bool hasTransientInternal(
const Client* c,
bool indirect, ConstClientList& set )
const;
446 void finishWindowRules();
447 void setShortcutInternal(
const TDEShortcut& cut );
449 void updateWorkareaDiffs();
450 void checkDirection(
int new_diff,
int old_diff, TQRect& rect,
const TQRect& area );
451 static int computeWorkareaDiff(
int left,
int right,
int a_left,
int a_right );
452 void configureRequest(
int value_mask,
int rx,
int ry,
int rw,
int rh,
int gravity,
bool from_tool );
453 NETExtendedStrut strut()
const;
454 int checkShadeGeometry(
int w,
int h );
455 void postponeGeometryUpdates(
bool postpone );
457 bool startMoveResize();
458 void finishMoveResize(
bool cancel );
459 void leaveMoveResize();
460 void checkUnrestrictedMoveResize();
461 void handleMoveResize(
int x,
int y,
int x_root,
int y_root );
462 void positionGeometryTip();
463 void grabButton(
int mod );
464 void ungrabButton(
int mod );
465 void resetMaximize();
466 void resizeDecoration(
const TQSize& s );
469 void killProcess(
bool ask, Time timestamp = CurrentTime );
470 void updateUrgency();
471 static void sendClientMessage( Window w, Atom a, Atom protocol,
472 long data1 = 0,
long data2 = 0,
long data3 = 0 );
474 void embedClient( Window w,
const XWindowAttributes &attr );
475 void detectNoBorder();
476 void detectShapable();
477 void destroyDecoration();
478 void updateFrameExtents();
483 Time readUserTimeMapTimestamp(
const TDEStartupInfoId* asn_id,
const TDEStartupInfoData* asn_data,
484 bool session )
const;
485 Time readUserCreationTime()
const;
486 static bool sameAppWindowRoleMatch(
const Client* c1,
const Client* c2,
bool active_hack );
487 void startupIdChanged();
492 KDecoration* decoration;
498 bool inhibitConfigureRequests;
499 bool move_faked_activity;
500 Window move_resize_grab_window;
501 bool unrestrictedMoveResize;
504 return moveResizeMode && mode == PositionCenter;
506 bool isResize()
const
508 return moveResizeMode && mode != PositionCenter;
513 TQPoint invertedMoveOffset;
514 TQRect moveResizeGeom;
515 TQRect initialMoveResizeGeom;
516 XSizeHints xSizeHint;
517 void sendSyntheticConfigureNotify();
519 void readTransient();
520 Window verifyTransientFor( Window transient_for,
bool set );
521 void addTransient(
Client* cl );
522 void removeTransient(
Client* cl );
523 void removeFromMainClients();
524 void cleanGrouping();
525 void checkGroupTransients();
526 void setTransient( Window new_transient_for_id );
528 Window transient_for_id;
529 Window original_transient_for_id;
530 ClientList transients_list;
531 ShadeMode shade_mode;
536 uint skip_taskbar :1;
537 uint original_skip_taskbar :1;
538 uint Pdeletewindow :1;
540 uint Ptakeactivity : 1;
541 uint Pcontexthelp : 1;
545 uint motif_noborder : 1;
546 uint motif_may_resize : 1;
547 uint motif_may_move :1;
548 uint motif_may_close : 1;
554 uint user_noborder : 1;
556 uint ignore_focus_stealing : 1;
557 uint demands_attention : 1;
558 uint user_noborder_forced : 1;
559 WindowRules client_rules;
562 void getWindowProtocols();
564 TQPixmap miniicon_pix;
568 enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
569 FullScreenMode fullscreen_mode;
570 MaximizeMode max_mode;
572 TQRect geom_fs_restore;
573 MaximizeMode maxmode_restore;
574 int workarea_diff_x, workarea_diff_y;
576 TQTimer* autoRaiseTimer;
577 TQTimer* shadeHoverTimer;
578 TQTimer* configureRequestTimer;
580 TQCString resource_name;
581 TQCString resource_class;
582 TQCString client_machine;
583 TQString cap_normal, cap_iconic, cap_suffix;
584 WId wmClientLeaderWin;
585 TQCString window_role;
590 TDEProcess* process_killer;
591 TDEProcess* process_resumer;
594 unsigned long allowed_actions;
595 TQRect frame_geometry;
597 int postpone_geometry_updates;
598 bool pending_geometry_update;
599 bool shade_geometry_change;
600 int border_left, border_right, border_top, border_bottom;
602 Client* shadowAfterClient;
603 TQWidget* shadowWidget;
604 TQMemArray<double> activeOpacityCache;
605 TQMemArray<double> inactiveOpacityCache;
606 TQMemArray<double>* opacityCache;
607 TQRegion shapeBoundingRegion;
608 TQTimer* shadowDelayTimer;
612 static bool check_active_modal;
613 TDEShortcut _shortcut;
614 friend struct FetchNameInternalPredicate;
615 friend struct CheckIgnoreFocusStealingProcedure;
616 friend struct ResetupRulesProcedure;
617 friend class GeometryUpdatesPostponer;
618 void show() { assert(
false ); }
619 void hide() { assert(
false ); }
623 uint rule_opacity_active;
624 uint rule_opacity_inactive;
627 TQTimer* demandAttentionKNotifyTimer;
629 bool activeMaximizing;
631 ActiveMaximizingMode activeMode;
633 ActiveBorder currentActiveBorder;
635 friend bool performTransiencyCheck();
636 bool minimized_before_suspend;