Changeset View
Changeset View
Standalone View
Standalone View
x11client.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org> | 5 | Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org> | ||
6 | Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> | 6 | Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> | ||
7 | Copyright (C) 2019 Vlad Zahorodnii <vladzzag@gmail.com> | ||||
7 | 8 | | |||
8 | This program is free software; you can redistribute it and/or modify | 9 | 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 | 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 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | 12 | (at your option) any later version. | ||
12 | 13 | | |||
13 | This program is distributed in the hope that it will be useful, | 14 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 37 Lines | |||||
52 | */ | 53 | */ | ||
53 | enum class Predicate { | 54 | enum class Predicate { | ||
54 | WindowMatch, | 55 | WindowMatch, | ||
55 | WrapperIdMatch, | 56 | WrapperIdMatch, | ||
56 | FrameIdMatch, | 57 | FrameIdMatch, | ||
57 | InputIdMatch | 58 | InputIdMatch | ||
58 | }; | 59 | }; | ||
59 | 60 | | |||
61 | /** | ||||
62 | * The X11Client class represents a managed X11 client. | ||||
63 | * | ||||
64 | * Note that override-redirect clients are represented by instances of the Unmanaged class. | ||||
65 | * | ||||
66 | * Each X11 client has three geometries associated with it - frame, client, and server. The frame | ||||
67 | * geometry is the most easiest one to understand, it specifies visible bounds of the window from | ||||
68 | * the user's perspective. The frame geometry doesn't include server-side and client-side drop | ||||
69 | * shadows. Window operations such resizing, snapping, tiling and so on must operate on this kind | ||||
70 | * of geometry. The client geometry specifies a rectangle on the screen occupied by the client | ||||
71 | * window. The server-side decoration, if any, must be put around the client geometry. The server | ||||
72 | * geometry specifies the server-side geometry of the frame window. | ||||
73 | * | ||||
74 | * There is no strict order between the frame and the client geometry. Either one of them can be | ||||
75 | * inside the other one. However, it's always guaranteed that both of them are inside the server | ||||
76 | * geometry. | ||||
77 | * | ||||
78 | * The buffer geometry is an alias for the client geometry. | ||||
79 | */ | ||||
60 | class KWIN_EXPORT X11Client : public AbstractClient | 80 | class KWIN_EXPORT X11Client : public AbstractClient | ||
61 | { | 81 | { | ||
62 | Q_OBJECT | 82 | Q_OBJECT | ||
63 | /** | 83 | /** | ||
64 | * By how much the window wishes to grow/shrink at least. Usually QSize(1,1). | 84 | * By how much the window wishes to grow/shrink at least. Usually QSize(1,1). | ||
65 | * MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all. | 85 | * MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all. | ||
66 | * The value is evaluated each time the getter is called. | 86 | * The value is evaluated each time the getter is called. | ||
67 | * Because of that no changed signal is provided. | 87 | * Because of that no changed signal is provided. | ||
Show All 17 Lines | |||||
85 | Q_PROPERTY(bool clientSideDecorated READ isClientSideDecorated NOTIFY clientSideDecoratedChanged) | 105 | Q_PROPERTY(bool clientSideDecorated READ isClientSideDecorated NOTIFY clientSideDecoratedChanged) | ||
86 | public: | 106 | public: | ||
87 | explicit X11Client(); | 107 | explicit X11Client(); | ||
88 | xcb_window_t wrapperId() const; | 108 | xcb_window_t wrapperId() const; | ||
89 | xcb_window_t inputId() const { return m_decoInputExtent; } | 109 | xcb_window_t inputId() const { return m_decoInputExtent; } | ||
90 | xcb_window_t frameId() const override; | 110 | xcb_window_t frameId() const override; | ||
91 | 111 | | |||
92 | QRect bufferGeometry() const override; | 112 | QRect bufferGeometry() const override; | ||
93 | QMargins bufferMargins() const override; | | |||
94 | 113 | | |||
95 | QPoint framePosToClientPos(const QPoint &point) const override; | 114 | QPoint framePosToClientPos(const QPoint &point) const override; | ||
96 | QPoint clientPosToFramePos(const QPoint &point) const override; | 115 | QPoint clientPosToFramePos(const QPoint &point) const override; | ||
97 | QSize frameSizeToClientSize(const QSize &size) const override; | 116 | QSize frameSizeToClientSize(const QSize &size) const override; | ||
98 | QSize clientSizeToFrameSize(const QSize &size) const override; | 117 | QSize clientSizeToFrameSize(const QSize &size) const override; | ||
99 | 118 | | |||
100 | bool isTransient() const override; | 119 | bool isTransient() const override; | ||
101 | bool groupTransient() const override; | 120 | bool groupTransient() const override; | ||
▲ Show 20 Lines • Show All 339 Lines • ▼ Show 20 Line(s) | 459 | static void sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, | |||
441 | uint32_t data1 = 0, uint32_t data2 = 0, uint32_t data3 = 0, | 460 | uint32_t data1 = 0, uint32_t data2 = 0, uint32_t data3 = 0, | ||
442 | xcb_timestamp_t timestamp = xTime()); | 461 | xcb_timestamp_t timestamp = xTime()); | ||
443 | 462 | | |||
444 | void embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth); | 463 | void embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth); | ||
445 | void detectNoBorder(); | 464 | void detectNoBorder(); | ||
446 | void destroyDecoration() override; | 465 | void destroyDecoration() override; | ||
447 | void updateFrameExtents(); | 466 | void updateFrameExtents(); | ||
448 | void setClientFrameExtents(const NETStrut &strut); | 467 | 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; | | |||
452 | 468 | | |||
453 | void internalShow(); | 469 | void internalShow(); | ||
454 | void internalHide(); | 470 | void internalHide(); | ||
455 | void internalKeep(); | 471 | void internalKeep(); | ||
456 | void map(); | 472 | void map(); | ||
457 | void unmap(); | 473 | void unmap(); | ||
458 | void updateHiddenPreview(); | 474 | void updateHiddenPreview(); | ||
459 | 475 | void updateServerGeometry(); | |||
460 | void updateInputShape(); | 476 | void updateInputShape(); | ||
461 | 477 | | |||
462 | xcb_timestamp_t readUserTimeMapTimestamp(const KStartupInfoId* asn_id, const KStartupInfoData* asn_data, | 478 | xcb_timestamp_t readUserTimeMapTimestamp(const KStartupInfoId* asn_id, const KStartupInfoData* asn_data, | ||
463 | bool session) const; | 479 | bool session) const; | ||
464 | xcb_timestamp_t readUserCreationTime() const; | 480 | xcb_timestamp_t readUserCreationTime() const; | ||
465 | void startupIdChanged(); | 481 | void startupIdChanged(); | ||
466 | 482 | | |||
467 | void updateInputWindow(); | 483 | void updateInputWindow(); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
517 | bool blocks_compositing; | 533 | bool blocks_compositing; | ||
518 | 534 | | |||
519 | enum FullScreenMode { | 535 | enum FullScreenMode { | ||
520 | FullScreenNone, | 536 | FullScreenNone, | ||
521 | FullScreenNormal | 537 | FullScreenNormal | ||
522 | } m_fullscreenMode; | 538 | } m_fullscreenMode; | ||
523 | 539 | | |||
524 | MaximizeMode max_mode; | 540 | MaximizeMode max_mode; | ||
525 | QRect m_bufferGeometry = QRect(0, 0, 100, 100); | 541 | QRect m_serverGeometry = QRect(0, 0, 100, 100); | ||
526 | QRect m_clientGeometry = QRect(0, 0, 100, 100); | 542 | QRect m_clientGeometry = QRect(0, 0, 100, 100); | ||
527 | QRect geom_restore; | 543 | QRect geom_restore; | ||
528 | QRect geom_fs_restore; | 544 | QRect geom_fs_restore; | ||
529 | QTimer* shadeHoverTimer; | 545 | QTimer* shadeHoverTimer; | ||
530 | xcb_colormap_t m_colormap; | 546 | xcb_colormap_t m_colormap; | ||
531 | QString cap_normal, cap_iconic, cap_suffix; | 547 | QString cap_normal, cap_iconic, cap_suffix; | ||
532 | Group* in_group; | 548 | Group* in_group; | ||
533 | QTimer* ping_timer; | 549 | QTimer* ping_timer; | ||
▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines |