Changeset View
Changeset View
Standalone View
Standalone View
x11client.h
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 86 | public: | |||
---|---|---|---|---|---|
87 | explicit X11Client(); | 87 | explicit X11Client(); | ||
88 | xcb_window_t wrapperId() const; | 88 | xcb_window_t wrapperId() const; | ||
89 | xcb_window_t inputId() const { return m_decoInputExtent; } | 89 | xcb_window_t inputId() const { return m_decoInputExtent; } | ||
90 | xcb_window_t frameId() const override; | 90 | xcb_window_t frameId() const override; | ||
91 | 91 | | |||
92 | QRect bufferGeometry() const override; | 92 | QRect bufferGeometry() const override; | ||
93 | QMargins bufferMargins() const override; | 93 | QMargins bufferMargins() const override; | ||
94 | 94 | | |||
95 | QPoint framePosToClientPos(const QPoint &point) const override; | ||||
96 | QPoint clientPosToFramePos(const QPoint &point) const override; | ||||
97 | QSize frameSizeToClientSize(const QSize &size) const override; | ||||
98 | QSize clientSizeToFrameSize(const QSize &size) const override; | ||||
99 | | ||||
95 | bool isTransient() const override; | 100 | bool isTransient() const override; | ||
96 | bool groupTransient() const override; | 101 | bool groupTransient() const override; | ||
97 | bool wasOriginallyGroupTransient() const; | 102 | bool wasOriginallyGroupTransient() const; | ||
98 | QList<AbstractClient*> mainClients() const override; // Call once before loop , is not indirect | 103 | QList<AbstractClient*> mainClients() const override; // Call once before loop , is not indirect | ||
99 | bool hasTransient(const AbstractClient* c, bool indirect) const override; | 104 | bool hasTransient(const AbstractClient* c, bool indirect) const override; | ||
100 | void checkTransient(xcb_window_t w); | 105 | void checkTransient(xcb_window_t w); | ||
101 | AbstractClient* findModal(bool allow_itself = false) override; | 106 | AbstractClient* findModal(bool allow_itself = false) override; | ||
102 | const Group* group() const override; | 107 | const Group* group() const override; | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
171 | bool isCloseable() const override; ///< May be closed by the user (May have a close button) | 176 | bool isCloseable() const override; ///< May be closed by the user (May have a close button) | ||
172 | 177 | | |||
173 | void takeFocus() override; | 178 | void takeFocus() override; | ||
174 | 179 | | |||
175 | void updateDecoration(bool check_workspace_pos, bool force = false) override; | 180 | void updateDecoration(bool check_workspace_pos, bool force = false) override; | ||
176 | 181 | | |||
177 | void updateShape(); | 182 | void updateShape(); | ||
178 | 183 | | |||
184 | using AbstractClient::move; | ||||
185 | void move(int x, int y, ForceGeometry_t force = NormalGeometrySet) override; | ||||
179 | using AbstractClient::setFrameGeometry; | 186 | using AbstractClient::setFrameGeometry; | ||
180 | void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | 187 | void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | ||
181 | /// plainResize() simply resizes | 188 | /// plainResize() simply resizes | ||
182 | void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet); | 189 | void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet); | ||
183 | void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet); | 190 | void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet); | ||
184 | /// resizeWithChecks() resizes according to gravity, and checks workarea position | 191 | /// resizeWithChecks() resizes according to gravity, and checks workarea position | ||
185 | using AbstractClient::resizeWithChecks; | 192 | using AbstractClient::resizeWithChecks; | ||
186 | void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | 193 | void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | ||
Show All 28 Lines | 221 | QString captionSuffix() const override { | |||
215 | return cap_suffix; | 222 | return cap_suffix; | ||
216 | } | 223 | } | ||
217 | 224 | | |||
218 | using AbstractClient::keyPressEvent; | 225 | using AbstractClient::keyPressEvent; | ||
219 | void keyPressEvent(uint key_code, xcb_timestamp_t time); // FRAME ?? | 226 | void keyPressEvent(uint key_code, xcb_timestamp_t time); // FRAME ?? | ||
220 | void updateMouseGrab() override; | 227 | void updateMouseGrab() override; | ||
221 | xcb_window_t moveResizeGrabWindow() const; | 228 | xcb_window_t moveResizeGrabWindow() const; | ||
222 | 229 | | |||
223 | const QPoint calculateGravitation(bool invert, int gravity = 0) const; // FRAME public? | 230 | QPoint gravityAdjustment(xcb_gravity_t gravity) const; | ||
231 | const QPoint calculateGravitation(bool invert) const; | ||||
224 | 232 | | |||
225 | void NETMoveResize(int x_root, int y_root, NET::Direction direction); | 233 | void NETMoveResize(int x_root, int y_root, NET::Direction direction); | ||
226 | void NETMoveResizeWindow(int flags, int x, int y, int width, int height); | 234 | void NETMoveResizeWindow(int flags, int x, int y, int width, int height); | ||
227 | void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp, | 235 | void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp, | ||
228 | bool send_event = false); | 236 | bool send_event = false); | ||
229 | 237 | | |||
230 | void gotPing(xcb_timestamp_t timestamp); | 238 | void gotPing(xcb_timestamp_t timestamp); | ||
231 | 239 | | |||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | 357 | protected: | |||
355 | void doSetKeepBelow() override; | 363 | void doSetKeepBelow() override; | ||
356 | void doSetDesktop(int desktop, int was_desk) override; | 364 | void doSetDesktop(int desktop, int was_desk) override; | ||
357 | void doMinimize() override; | 365 | void doMinimize() override; | ||
358 | void doSetSkipPager() override; | 366 | void doSetSkipPager() override; | ||
359 | void doSetSkipTaskbar() override; | 367 | void doSetSkipTaskbar() override; | ||
360 | void doSetSkipSwitcher() override; | 368 | void doSetSkipSwitcher() override; | ||
361 | bool belongsToDesktop() const override; | 369 | bool belongsToDesktop() const override; | ||
362 | void setGeometryRestore(const QRect &geo) override; | 370 | void setGeometryRestore(const QRect &geo) override; | ||
363 | void doMove(int x, int y) override; | | |||
364 | bool doStartMoveResize() override; | 371 | bool doStartMoveResize() override; | ||
365 | void doPerformMoveResize() override; | 372 | void doPerformMoveResize() override; | ||
366 | bool isWaitingForMoveResizeSync() const override; | 373 | bool isWaitingForMoveResizeSync() const override; | ||
367 | void doResizeSync() override; | 374 | void doResizeSync() override; | ||
368 | QSize resizeIncrements() const override; | 375 | QSize resizeIncrements() const override; | ||
369 | bool acceptsFocus() const override; | 376 | bool acceptsFocus() const override; | ||
370 | 377 | | |||
371 | //Signals for the scripting interface | 378 | //Signals for the scripting interface | ||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 409 | private: | |||
431 | void killProcess(bool ask, xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); | 438 | void killProcess(bool ask, xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); | ||
432 | void updateUrgency(); | 439 | void updateUrgency(); | ||
433 | static void sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, | 440 | static void sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, | ||
434 | uint32_t data1 = 0, uint32_t data2 = 0, uint32_t data3 = 0, | 441 | uint32_t data1 = 0, uint32_t data2 = 0, uint32_t data3 = 0, | ||
435 | xcb_timestamp_t timestamp = xTime()); | 442 | xcb_timestamp_t timestamp = xTime()); | ||
436 | 443 | | |||
437 | void embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth); | 444 | void embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth); | ||
438 | void detectNoBorder(); | 445 | void detectNoBorder(); | ||
439 | Xcb::Property fetchGtkFrameExtents() const; | | |||
440 | void readGtkFrameExtents(Xcb::Property &prop); | | |||
441 | void detectGtkFrameExtents(); | | |||
442 | void destroyDecoration() override; | 446 | void destroyDecoration() override; | ||
443 | void updateFrameExtents(); | 447 | void updateFrameExtents(); | ||
448 | void setClientFrameExtents(const NETStrut &strut); | ||||
449 | bool canUpdatePosition(const QPoint &frame, const QPoint &buffer, ForceGeometry_t force) const; | ||||
450 | bool canUpdateSize(const QSize &frame, const QSize &buffer, ForceGeometry_t force) const; | ||||
451 | bool canUpdateGeometry(const QRect &frame, const QRect &buffer, ForceGeometry_t force) const; | ||||
444 | 452 | | |||
445 | void internalShow(); | 453 | void internalShow(); | ||
446 | void internalHide(); | 454 | void internalHide(); | ||
447 | void internalKeep(); | 455 | void internalKeep(); | ||
448 | void map(); | 456 | void map(); | ||
449 | void unmap(); | 457 | void unmap(); | ||
450 | void updateHiddenPreview(); | 458 | void updateHiddenPreview(); | ||
451 | 459 | | |||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
509 | bool blocks_compositing; | 517 | bool blocks_compositing; | ||
510 | 518 | | |||
511 | enum FullScreenMode { | 519 | enum FullScreenMode { | ||
512 | FullScreenNone, | 520 | FullScreenNone, | ||
513 | FullScreenNormal | 521 | FullScreenNormal | ||
514 | } m_fullscreenMode; | 522 | } m_fullscreenMode; | ||
515 | 523 | | |||
516 | MaximizeMode max_mode; | 524 | MaximizeMode max_mode; | ||
525 | QRect m_bufferGeometry = QRect(0, 0, 100, 100); | ||||
526 | QRect m_clientGeometry = QRect(0, 0, 100, 100); | ||||
517 | QRect geom_restore; | 527 | QRect geom_restore; | ||
518 | QRect geom_fs_restore; | 528 | QRect geom_fs_restore; | ||
519 | QTimer* shadeHoverTimer; | 529 | QTimer* shadeHoverTimer; | ||
520 | xcb_colormap_t m_colormap; | 530 | xcb_colormap_t m_colormap; | ||
521 | QString cap_normal, cap_iconic, cap_suffix; | 531 | QString cap_normal, cap_iconic, cap_suffix; | ||
522 | Group* in_group; | 532 | Group* in_group; | ||
523 | QTimer* ping_timer; | 533 | QTimer* ping_timer; | ||
524 | qint64 m_killHelperPID; | 534 | qint64 m_killHelperPID; | ||
525 | xcb_timestamp_t m_pingTimestamp; | 535 | xcb_timestamp_t m_pingTimestamp; | ||
526 | xcb_timestamp_t m_userTime; | 536 | xcb_timestamp_t m_userTime; | ||
527 | NET::Actions allowed_actions; | 537 | NET::Actions allowed_actions; | ||
528 | QSize client_size; | | |||
529 | bool shade_geometry_change; | 538 | bool shade_geometry_change; | ||
530 | SyncRequest syncRequest; | 539 | SyncRequest syncRequest; | ||
531 | static bool check_active_modal; ///< \see X11Client::checkActiveModal() | 540 | static bool check_active_modal; ///< \see X11Client::checkActiveModal() | ||
532 | int sm_stacking_order; | 541 | int sm_stacking_order; | ||
533 | friend struct ResetupRulesProcedure; | 542 | friend struct ResetupRulesProcedure; | ||
534 | 543 | | |||
535 | friend bool performTransiencyCheck(); | 544 | friend bool performTransiencyCheck(); | ||
536 | 545 | | |||
537 | Xcb::StringProperty fetchActivities() const; | 546 | Xcb::StringProperty fetchActivities() const; | ||
538 | void readActivities(Xcb::StringProperty &property); | 547 | void readActivities(Xcb::StringProperty &property); | ||
539 | void checkActivities(); | 548 | void checkActivities(); | ||
540 | bool activitiesDefined; //whether the x property was actually set | 549 | bool activitiesDefined; //whether the x property was actually set | ||
541 | 550 | | |||
542 | bool sessionActivityOverride; | 551 | bool sessionActivityOverride; | ||
543 | bool needsXWindowMove; | 552 | bool needsXWindowMove; | ||
544 | 553 | | |||
545 | Xcb::Window m_decoInputExtent; | 554 | Xcb::Window m_decoInputExtent; | ||
546 | QPoint input_offset; | 555 | QPoint input_offset; | ||
547 | 556 | | |||
548 | QTimer *m_focusOutTimer; | 557 | QTimer *m_focusOutTimer; | ||
549 | 558 | | |||
550 | QList<QMetaObject::Connection> m_connections; | 559 | QList<QMetaObject::Connection> m_connections; | ||
551 | bool m_clientSideDecorated; | | |||
552 | 560 | | |||
553 | QMetaObject::Connection m_edgeRemoveConnection; | 561 | QMetaObject::Connection m_edgeRemoveConnection; | ||
554 | QMetaObject::Connection m_edgeGeometryTrackingConnection; | 562 | QMetaObject::Connection m_edgeGeometryTrackingConnection; | ||
563 | | ||||
564 | QMargins m_clientFrameExtents; | ||||
555 | }; | 565 | }; | ||
556 | 566 | | |||
557 | inline xcb_window_t X11Client::wrapperId() const | 567 | inline xcb_window_t X11Client::wrapperId() const | ||
558 | { | 568 | { | ||
559 | return m_wrapper; | 569 | return m_wrapper; | ||
560 | } | 570 | } | ||
561 | 571 | | |||
562 | inline bool X11Client::isClientSideDecorated() const | 572 | inline bool X11Client::isClientSideDecorated() const | ||
563 | { | 573 | { | ||
564 | return m_clientSideDecorated; | 574 | return !m_clientFrameExtents.isNull(); | ||
565 | } | 575 | } | ||
566 | 576 | | |||
567 | inline bool X11Client::groupTransient() const | 577 | inline bool X11Client::groupTransient() const | ||
568 | { | 578 | { | ||
569 | return m_transientForId == rootWindow(); | 579 | return m_transientForId == rootWindow(); | ||
570 | } | 580 | } | ||
571 | 581 | | |||
572 | // Needed because verifyTransientFor() may set transient_for_id to root window, | 582 | // Needed because verifyTransientFor() may set transient_for_id to root window, | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | |||||
643 | 653 | | |||
644 | inline bool X11Client::isManaged() const | 654 | inline bool X11Client::isManaged() const | ||
645 | { | 655 | { | ||
646 | return m_managed; | 656 | return m_managed; | ||
647 | } | 657 | } | ||
648 | 658 | | |||
649 | inline QSize X11Client::clientSize() const | 659 | inline QSize X11Client::clientSize() const | ||
650 | { | 660 | { | ||
651 | return client_size; | 661 | return m_clientGeometry.size(); | ||
652 | } | 662 | } | ||
653 | 663 | | |||
654 | inline void X11Client::plainResize(const QSize& s, ForceGeometry_t force) | 664 | inline void X11Client::plainResize(const QSize& s, ForceGeometry_t force) | ||
655 | { | 665 | { | ||
656 | plainResize(s.width(), s.height(), force); | 666 | plainResize(s.width(), s.height(), force); | ||
657 | } | 667 | } | ||
658 | 668 | | |||
659 | inline void X11Client::resizeWithChecks(int w, int h, AbstractClient::ForceGeometry_t force) | 669 | inline void X11Client::resizeWithChecks(int w, int h, AbstractClient::ForceGeometry_t force) | ||
Show All 34 Lines |