Skip to content

Commit eb1383a

Browse files
committed
fix decorationsType handle error
1 parent ad892b4 commit eb1383a

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

examples/tinywl/helper.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ void Helper::init()
299299
auto xwayland = qobject_cast<WXWaylandSurface *>(wrapper->shellSurface());
300300
auto updateDecorationTitleBar = [this, wrapper, xwayland]() {
301301
if (!xwayland->isBypassManager()) {
302-
wrapper->setNoTitleBar(xwayland->decorationsType()
303-
== WXWaylandSurface::DecorationsNoTitle);
304-
wrapper->setNoDecoration(xwayland->decorationsType()
305-
== WXWaylandSurface::DecorationsNoBorder);
302+
wrapper->setNoTitleBar(xwayland->decorationsTypes()
303+
& WXWaylandSurface::DecorationsNoTitle);
304+
wrapper->setNoDecoration(xwayland->decorationsTypes()
305+
& WXWaylandSurface::DecorationsNoBorder);
306306
} else {
307307
wrapper->setNoTitleBar(true);
308308
wrapper->setNoDecoration(true);
@@ -312,7 +312,7 @@ void Helper::init()
312312
// but WXWaylandSurface will not, so must connect to `wrapper`
313313
connect(xwayland, &WXWaylandSurface::bypassManagerChanged, wrapper, updateDecorationTitleBar);
314314
connect(xwayland,
315-
&WXWaylandSurface::decorationsTypeChanged,
315+
&WXWaylandSurface::decorationsTypesChanged,
316316
wrapper,
317317
updateDecorationTitleBar);
318318
updateDecorationTitleBar();

src/server/protocols/wxwaylandsurface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void WXWaylandSurfacePrivate::init()
139139
updateWindowTypes();
140140
});
141141
QObject::connect(handle(), &qw_xwayland_surface::notify_set_decorations,
142-
q, &WXWaylandSurface::decorationsTypeChanged);
142+
q, &WXWaylandSurface::decorationsTypesChanged);
143143
QObject::connect(handle(), &qw_xwayland_surface::notify_set_title,
144144
q, &WXWaylandSurface::titleChanged);
145145
QObject::connect(handle(), &qw_xwayland_surface::notify_set_class,
@@ -455,10 +455,10 @@ WXWaylandSurface::WindowTypes WXWaylandSurface::windowTypes() const
455455
return d->windowTypes;
456456
}
457457

458-
WXWaylandSurface::DecorationsType WXWaylandSurface::decorationsType() const
458+
WXWaylandSurface::DecorationsTypes WXWaylandSurface::decorationsTypes() const
459459
{
460460
W_DC(WXWaylandSurface);
461-
return static_cast<DecorationsType>(d->nativeHandle()->decorations);
461+
return static_cast<DecorationsTypes>(d->nativeHandle()->decorations);
462462
}
463463

464464
bool WXWaylandSurface::checkNewSize(const QSize &size, QSize *clipedSize)

src/server/protocols/wxwaylandsurface.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class WAYLIB_SERVER_EXPORT WXWaylandSurface : public WToplevelSurface
2828
Q_PROPERTY(bool bypassManager READ isBypassManager NOTIFY bypassManagerChanged FINAL)
2929
Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged FINAL)
3030
Q_PROPERTY(WindowTypes windowTypes READ windowTypes NOTIFY windowTypesChanged FINAL)
31-
Q_PROPERTY(DecorationsType decorationsType READ decorationsType NOTIFY decorationsTypeChanged FINAL)
31+
Q_PROPERTY(DecorationsTypes decorationsTypes READ decorationsTypes NOTIFY decorationsTypesChanged FINAL)
3232
QML_NAMED_ELEMENT(XWaylandSurface)
3333
QML_UNCREATABLE("Only create in C++")
3434

@@ -74,6 +74,7 @@ class WAYLIB_SERVER_EXPORT WXWaylandSurface : public WToplevelSurface
7474
DecorationsNoTitle = 2
7575
};
7676
Q_ENUM(DecorationsType)
77+
Q_DECLARE_FLAGS(DecorationsTypes, DecorationsType)
7778

7879
explicit WXWaylandSurface(QW_NAMESPACE::qw_xwayland_surface *handle, WXWayland *xwayland, QObject *parent = nullptr);
7980
~WXWaylandSurface();
@@ -111,7 +112,7 @@ class WAYLIB_SERVER_EXPORT WXWaylandSurface : public WToplevelSurface
111112

112113
bool isBypassManager() const;
113114
WindowTypes windowTypes() const;
114-
DecorationsType decorationsType() const;
115+
DecorationsTypes decorationsTypes() const;
115116

116117
public Q_SLOTS:
117118
bool checkNewSize(const QSize &size, QSize *clipedSize = nullptr) override;
@@ -132,7 +133,7 @@ public Q_SLOTS:
132133
void bypassManagerChanged();
133134
void geometryChanged();
134135
void windowTypesChanged();
135-
void decorationsTypeChanged();
136+
void decorationsTypesChanged();
136137

137138
void requestConfigure(QRect geometry, ConfigureFlags flags);
138139
void requestActivate();

0 commit comments

Comments
 (0)