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
Graphics
KRuler
Commits
d74e5255
Unverified
Commit
d74e5255
authored
Aug 25, 2022
by
Carl Schwan
🚴
Browse files
Support wayland
BUG: 432521
Signed-off-by:
Carl Schwan
<
carl@carlschwan.eu
>
parent
b06fab24
Changes
1
Hide whitespace changes
Inline
Side-by-side
klineal.cpp
View file @
d74e5255
...
...
@@ -665,30 +665,39 @@ void KLineal::mousePressEvent( QMouseEvent *inEvent )
#ifdef KRULER_HAVE_X11
bool
KLineal
::
nativeMove
()
const
{
return
QX11Info
::
isPlatformX11
()
&&
RulerSettings
::
self
()
->
nativeMoving
();
return
(
mWayland
||
(
QX11Info
::
isPlatformX11
()
&&
RulerSettings
::
self
()
->
nativeMoving
()
))
;
}
void
KLineal
::
startNativeMove
(
QMouseEvent
*
inEvent
)
{
xcb_ungrab_pointer
(
QX11Info
::
connection
(),
QX11Info
::
appTime
()
);
NETRootInfo
wm_root
(
QX11Info
::
connection
(),
NET
::
WMMoveResize
);
wm_root
.
moveResizeRequest
(
winId
(),
inEvent
->
globalX
(),
inEvent
->
globalY
(),
NET
::
Move
);
if
(
mWayland
)
{
windowHandle
()
->
startSystemMove
();
}
else
{
xcb_ungrab_pointer
(
QX11Info
::
connection
(),
QX11Info
::
appTime
()
);
NETRootInfo
wm_root
(
QX11Info
::
connection
(),
NET
::
WMMoveResize
);
wm_root
.
moveResizeRequest
(
winId
(),
inEvent
->
globalX
(),
inEvent
->
globalY
(),
NET
::
Move
);
}
}
void
KLineal
::
stopNativeMove
(
QMouseEvent
*
inEvent
)
{
NETRootInfo
wm_root
(
QX11Info
::
connection
(),
NET
::
WMMoveResize
);
wm_root
.
moveResizeRequest
(
winId
(),
inEvent
->
globalX
(),
inEvent
->
globalY
(),
NET
::
MoveResizeCancel
);
if
(
!
mWayland
)
{
NETRootInfo
wm_root
(
QX11Info
::
connection
(),
NET
::
WMMoveResize
);
wm_root
.
moveResizeRequest
(
winId
(),
inEvent
->
globalX
(),
inEvent
->
globalY
(),
NET
::
MoveResizeCancel
);
}
}
#else
bool
KLineal
::
nativeMove
()
const
{
return
false
;
return
mWayland
;
}
void
KLineal
::
startNativeMove
(
QMouseEvent
*
inEvent
)
{
Q_UNUSED
(
inEvent
);
if
(
mWayland
)
{
windowHandle
()
->
startSystemMove
();
}
}
void
KLineal
::
stopNativeMove
(
QMouseEvent
*
inEvent
)
...
...
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