Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWayland Server
Commits
5c3bb7d9
Commit
5c3bb7d9
authored
Nov 30, 2020
by
Jan Blackquill
🌈
Committed by
Jan Blackquill
Jan 05, 2021
Browse files
xdgshell: wrap v3 of xdgshell protocol
parent
380b91e4
Pipeline
#46534
passed with stage
in 6 minutes and 54 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
5c3bb7d9
...
...
@@ -52,7 +52,7 @@ set_package_properties(Wayland PROPERTIES
find_package
(
WaylandScanner
)
find_package
(
WaylandProtocols 1.1
8
)
find_package
(
WaylandProtocols 1.1
9
)
set_package_properties
(
WaylandProtocols PROPERTIES TYPE REQUIRED
)
find_package
(
EGL
)
...
...
src/server/xdgshell_interface.cpp
View file @
5c3bb7d9
...
...
@@ -17,7 +17,7 @@
namespace
KWaylandServer
{
static
const
int
s_version
=
2
;
static
const
int
s_version
=
3
;
XdgShellInterfacePrivate
::
XdgShellInterfacePrivate
(
XdgShellInterface
*
shell
)
:
q
(
shell
)
...
...
@@ -705,6 +705,13 @@ void XdgPopupInterfacePrivate::xdg_popup_grab(Resource *resource, ::wl_resource
emit
q
->
grabRequested
(
seat
,
serial
);
}
void
XdgPopupInterfacePrivate
::
xdg_popup_reposition
(
Resource
*
resource
,
::
wl_resource
*
positionerResource
,
uint32_t
token
)
{
Q_UNUSED
(
resource
)
positioner
=
XdgPositioner
::
get
(
positionerResource
);
emit
q
->
repositionRequested
(
token
);
}
XdgPopupInterface
::
XdgPopupInterface
(
XdgSurfaceInterface
*
surface
,
SurfaceInterface
*
parentSurface
,
const
XdgPositioner
&
positioner
,
...
...
@@ -763,6 +770,12 @@ void XdgPopupInterface::sendPopupDone()
d
->
send_popup_done
();
}
void
XdgPopupInterface
::
sendRepositioned
(
quint32
token
)
{
Q_ASSERT
(
d
->
resource
()
->
version
()
>=
XDG_POPUP_REPOSITIONED_SINCE_VERSION
);
d
->
send_repositioned
(
token
);
}
XdgPopupInterface
*
XdgPopupInterface
::
get
(
::
wl_resource
*
resource
)
{
if
(
auto
popupPrivate
=
resource_cast
<
XdgPopupInterfacePrivate
*>
(
resource
))
{
...
...
@@ -852,6 +865,24 @@ void XdgPositionerPrivate::xdg_positioner_set_anchor(Resource *resource, uint32_
}
}
void
XdgPositionerPrivate
::
xdg_positioner_set_parent_size
(
Resource
*
resource
,
int32_t
width
,
int32_t
height
)
{
Q_UNUSED
(
resource
)
data
->
parentSize
=
QSize
(
width
,
height
);
}
void
XdgPositionerPrivate
::
xdg_positioner_set_reactive
(
Resource
*
resource
)
{
Q_UNUSED
(
resource
)
data
->
isReactive
=
true
;
}
void
XdgPositionerPrivate
::
xdg_positioner_set_parent_configure
(
Resource
*
resource
,
uint32_t
serial
)
{
Q_UNUSED
(
resource
)
data
->
parentConfigure
=
serial
;
}
void
XdgPositionerPrivate
::
xdg_positioner_set_gravity
(
Resource
*
resource
,
uint32_t
gravity
)
{
if
(
gravity
>
gravity_bottom_right
)
{
...
...
@@ -1003,6 +1034,21 @@ QPoint XdgPositioner::offset() const
return
d
->
offset
;
}
QSize
XdgPositioner
::
parentSize
()
const
{
return
d
->
parentSize
;
}
bool
XdgPositioner
::
isReactive
()
const
{
return
d
->
isReactive
;
}
quint32
XdgPositioner
::
parentConfigure
()
const
{
return
d
->
parentConfigure
;
}
XdgPositioner
XdgPositioner
::
get
(
::
wl_resource
*
resource
)
{
XdgPositionerPrivate
*
xdgPositionerPrivate
=
XdgPositionerPrivate
::
get
(
resource
);
...
...
src/server/xdgshell_interface.h
View file @
5c3bb7d9
...
...
@@ -453,6 +453,21 @@ public:
*/
QPoint
offset
()
const
;
/**
* Returns whether the surface should respond to movements in its parent window.
*/
bool
isReactive
()
const
;
/**
* Returns the parent size to use when positioning the popup.
*/
QSize
parentSize
()
const
;
/**
* Returns the serial of the configure event for the parent window.
*/
quint32
parentConfigure
()
const
;
/**
* Returns the current state of the xdg positioner object identified by \a resource.
*/
...
...
@@ -521,6 +536,11 @@ public:
*/
void
sendPopupDone
();
/**
* Sends a popup repositioned event to the client.
*/
void
sendRepositioned
(
quint32
token
);
/**
* Returns the XdgPopupInterface for the specified wayland resource object \a resource.
*/
...
...
@@ -533,6 +553,7 @@ Q_SIGNALS:
*/
void
initializeRequested
();
void
grabRequested
(
SeatInterface
*
seat
,
quint32
serial
);
void
repositionRequested
(
quint32
token
);
private:
QScopedPointer
<
XdgPopupInterfacePrivate
>
d
;
...
...
src/server/xdgshell_interface_p.h
View file @
5c3bb7d9
...
...
@@ -56,6 +56,9 @@ public:
QPoint
offset
;
QSize
size
;
QRect
anchorRect
;
bool
isReactive
;
QSize
parentSize
;
quint32
parentConfigure
;
};
class
XdgPositionerPrivate
:
public
QtWaylandServer
::
xdg_positioner
...
...
@@ -76,6 +79,9 @@ protected:
void
xdg_positioner_set_gravity
(
Resource
*
resource
,
uint32_t
gravity
)
override
;
void
xdg_positioner_set_constraint_adjustment
(
Resource
*
resource
,
uint32_t
constraint_adjustment
)
override
;
void
xdg_positioner_set_offset
(
Resource
*
resource
,
int32_t
x
,
int32_t
y
)
override
;
void
xdg_positioner_set_reactive
(
Resource
*
resource
)
override
;
void
xdg_positioner_set_parent_size
(
Resource
*
resource
,
int32_t
width
,
int32_t
height
)
override
;
void
xdg_positioner_set_parent_configure
(
Resource
*
resource
,
uint32_t
serial
)
override
;
};
class
XdgSurfaceInterfacePrivate
:
public
QtWaylandServer
::
xdg_surface
...
...
@@ -178,6 +184,7 @@ protected:
void
xdg_popup_destroy_resource
(
Resource
*
resource
)
override
;
void
xdg_popup_destroy
(
Resource
*
resource
)
override
;
void
xdg_popup_grab
(
Resource
*
resource
,
::
wl_resource
*
seat
,
uint32_t
serial
)
override
;
void
xdg_popup_reposition
(
Resource
*
resource
,
struct
::
wl_resource
*
positioner
,
uint32_t
token
)
override
;
};
}
// namespace KWaylandServer
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment