Changeset View
Changeset View
Standalone View
Standalone View
src/server/plasmawindowmanagement_interface.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 70 | public: | |||
---|---|---|---|---|---|
77 | void setPid(quint32 pid); | 77 | void setPid(quint32 pid); | ||
78 | void setThemedIconName(const QString &iconName); | 78 | void setThemedIconName(const QString &iconName); | ||
79 | void setIcon(const QIcon &icon); | 79 | void setIcon(const QIcon &icon); | ||
80 | void setVirtualDesktop(quint32 desktop); | 80 | void setVirtualDesktop(quint32 desktop); | ||
81 | void unmap(); | 81 | void unmap(); | ||
82 | void setState(org_kde_plasma_window_management_state flag, bool set); | 82 | void setState(org_kde_plasma_window_management_state flag, bool set); | ||
83 | void setParentWindow(PlasmaWindowInterface *parent); | 83 | void setParentWindow(PlasmaWindowInterface *parent); | ||
84 | void setGeometry(const QRect &geometry); | 84 | void setGeometry(const QRect &geometry); | ||
85 | void setApplicationMenuPaths(const QString& service, const QString& object); | ||||
zzag: You forgot to fix coding style here ;-) | |||||
85 | wl_resource *resourceForParent(PlasmaWindowInterface *parent, wl_resource *child) const; | 86 | wl_resource *resourceForParent(PlasmaWindowInterface *parent, wl_resource *child) const; | ||
86 | 87 | | |||
87 | QVector<wl_resource*> resources; | 88 | QVector<wl_resource*> resources; | ||
88 | quint32 windowId = 0; | 89 | quint32 windowId = 0; | ||
89 | QHash<SurfaceInterface*, QRect> minimizedGeometries; | 90 | QHash<SurfaceInterface*, QRect> minimizedGeometries; | ||
90 | PlasmaWindowManagementInterface *wm; | 91 | PlasmaWindowManagementInterface *wm; | ||
91 | 92 | | |||
92 | bool unmapped = false; | 93 | bool unmapped = false; | ||
Show All 27 Lines | 99 | private: | |||
120 | QString m_themedIconName; | 121 | QString m_themedIconName; | ||
121 | QIcon m_icon; | 122 | QIcon m_icon; | ||
122 | quint32 m_virtualDesktop = 0; | 123 | quint32 m_virtualDesktop = 0; | ||
123 | quint32 m_state = 0; | 124 | quint32 m_state = 0; | ||
124 | wl_listener listener; | 125 | wl_listener listener; | ||
125 | static const struct org_kde_plasma_window_interface s_interface; | 126 | static const struct org_kde_plasma_window_interface s_interface; | ||
126 | }; | 127 | }; | ||
127 | 128 | | |||
128 | const quint32 PlasmaWindowManagementInterface::Private::s_version = 9; | 129 | const quint32 PlasmaWindowManagementInterface::Private::s_version = 9; | ||
davidedmundson: how is this 9 already? | |||||
Git blame shows that it's been 9 since 2018. Looks like someone made a mistake a while back? cblack: Git blame shows that it's been 9 since 2018. Looks like someone made a mistake a while back? | |||||
Urgh, it seems like versioning in the plasma window management protocol is messed up. For some reason, org_kde_plasma_window_management and org_kde_plasma_window have different versions. zzag: Urgh, it seems like versioning in the plasma window management protocol is messed up. For some… | |||||
129 | 130 | | |||
130 | PlasmaWindowManagementInterface::Private::Private(PlasmaWindowManagementInterface *q, Display *d) | 131 | PlasmaWindowManagementInterface::Private::Private(PlasmaWindowManagementInterface *q, Display *d) | ||
131 | : Global::Private(d, &org_kde_plasma_window_management_interface, s_version) | 132 | : Global::Private(d, &org_kde_plasma_window_management_interface, s_version) | ||
132 | , q(q) | 133 | , q(q) | ||
133 | { | 134 | { | ||
134 | } | 135 | } | ||
135 | 136 | | |||
136 | #ifndef K_DOXYGEN | 137 | #ifndef K_DOXYGEN | ||
▲ Show 20 Lines • Show All 446 Lines • ▼ Show 20 Line(s) | 583 | for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { | |||
583 | auto resource = *it; | 584 | auto resource = *it; | ||
584 | if (wl_resource_get_version(resource) < ORG_KDE_PLASMA_WINDOW_GEOMETRY_SINCE_VERSION) { | 585 | if (wl_resource_get_version(resource) < ORG_KDE_PLASMA_WINDOW_GEOMETRY_SINCE_VERSION) { | ||
585 | continue; | 586 | continue; | ||
586 | } | 587 | } | ||
587 | org_kde_plasma_window_send_geometry(resource, geometry.x(), geometry.y(), geometry.width(), geometry.height()); | 588 | org_kde_plasma_window_send_geometry(resource, geometry.x(), geometry.y(), geometry.width(), geometry.height()); | ||
588 | } | 589 | } | ||
589 | } | 590 | } | ||
590 | 591 | | |||
592 | void PlasmaWindowInterface::Private::setApplicationMenuPaths(const QString &service, const QString &object) | ||||
593 | { | ||||
594 | for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { | ||||
595 | auto resource = *it; | ||||
596 | if (wl_resource_get_version(resource) < ORG_KDE_PLASMA_WINDOW_APPLICATION_MENU_SINCE_VERSION) { | ||||
597 | continue; | ||||
598 | } | ||||
599 | org_kde_plasma_window_send_application_menu(resource, qUtf8Printable(service), qUtf8Printable(object)); | ||||
davidedmundson: We're mixing up our local 8bit and utf8 on different sides of this. | |||||
600 | } | ||||
601 | } | ||||
602 | | ||||
591 | void PlasmaWindowInterface::Private::closeCallback(wl_client *client, wl_resource *resource) | 603 | void PlasmaWindowInterface::Private::closeCallback(wl_client *client, wl_resource *resource) | ||
592 | { | 604 | { | ||
593 | Q_UNUSED(client) | 605 | Q_UNUSED(client) | ||
594 | Private *p = cast(resource); | 606 | Private *p = cast(resource); | ||
595 | emit p->q->closeRequested(); | 607 | emit p->q->closeRequested(); | ||
596 | } | 608 | } | ||
597 | 609 | | |||
598 | void PlasmaWindowInterface::Private::requestMoveCallback(wl_client *client, wl_resource *resource) | 610 | void PlasmaWindowInterface::Private::requestMoveCallback(wl_client *client, wl_resource *resource) | ||
▲ Show 20 Lines • Show All 342 Lines • ▼ Show 20 Line(s) | 952 | { | |||
941 | d->setParentWindow(parentWindow); | 953 | d->setParentWindow(parentWindow); | ||
942 | } | 954 | } | ||
943 | 955 | | |||
944 | void PlasmaWindowInterface::setGeometry(const QRect &geometry) | 956 | void PlasmaWindowInterface::setGeometry(const QRect &geometry) | ||
945 | { | 957 | { | ||
946 | d->setGeometry(geometry); | 958 | d->setGeometry(geometry); | ||
947 | } | 959 | } | ||
948 | 960 | | |||
961 | void PlasmaWindowInterface::setApplicationMenuPaths(const QString &serviceName, const QString &objectPath) | ||||
962 | { | ||||
963 | d->setApplicationMenuPaths(serviceName, objectPath); | ||||
964 | } | ||||
965 | | ||||
949 | } | 966 | } | ||
950 | } | 967 | } |
You forgot to fix coding style here ;-)