Skip to content

Commit 9bf3409

Browse files
committed
Kdecoration2 ->KDecoration3
Added a naive null check for transient Added the nextStateChanged handler (not sure if correct) Added deco->create call to init the state Run time tested X11 not wayland
1 parent b5f18e9 commit 9bf3409

61 files changed

Lines changed: 361 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ set_package_properties(Plasma PROPERTIES
127127
TYPE RUNTIME
128128
)
129129

130-
find_package(KDecoration2 ${KDE_PLASMA_VERSION}
130+
find_package(KDecoration3 ${KDE_PLASMA_VERSION}
131131
CONFIG REQUIRED
132132
)
133133

como/base/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ target_sources(base
1818
PUBLIC
1919
FILE_SET HEADERS
2020
FILES
21-
os/clock/linux_skew_notifier_engine.h
21+
os/clock/skew_notifier_engine.h
2222
os/clock/skew_notifier.h
2323
seat/backend/logind/session.h
2424
seat/session.h

como/base/wayland/app_singleton.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ class app_singleton : public base::app_singleton
1919
setenv("QT_QPA_PLATFORM", "wayland-org.kde.kwin.qpa", true);
2020
setenv("KWIN_FORCE_OWN_QPA", "1", true);
2121

22-
#if HAVE_SCHED_RESET_ON_FORK
2322
int const minPriority = sched_get_priority_min(SCHED_RR);
2423
sched_param sp;
2524
sp.sched_priority = minPriority;
26-
sched_setscheduler(0, SCHED_RR | SCHED_RESET_ON_FORK, &sp);
27-
#endif
25+
if (pthread_setschedparam(pthread_self(), SCHED_RR, &sp))
26+
return;
27+
28+
pthread_atfork(NULL, NULL, []() {
29+
sched_param sp;
30+
sp.sched_priority = 0;
31+
pthread_setschedparam(pthread_self(), SCHED_OTHER, &sp);
32+
});
2833

2934
qapp = std::make_unique<QApplication>(argc, argv);
3035
prepare_qapp();

como/input/device_redirect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
#pragma once
1010

11-
#include <KDecoration2/Private/DecoratedClientPrivate>
11+
#include <KDecoration3/Private/DecoratedWindowPrivate>
1212
#include <QWindow>
1313
#include <optional>
1414

@@ -38,7 +38,7 @@ struct device_redirect_focus {
3838
QWindow* internal_window{nullptr};
3939

4040
struct {
41-
KDecoration2::DecoratedClientPrivate* client{nullptr};
41+
KDecoration3::DecoratedWindowPrivate* client{nullptr};
4242

4343
// TODO(romangg): Make this unnecessary. Reuse instead the normal focus window.
4444
std::optional<Window> window;

como/render/deco_shadow.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,29 @@
1111
#include <como/win/deco.h>
1212
#include <como/win/scene.h>
1313

14-
#include <KDecoration2/Decoration>
15-
#include <KDecoration2/DecorationShadow>
14+
#include <KDecoration3/Decoration>
15+
#include <KDecoration3/DecorationShadow>
1616

1717
namespace como::render
1818
{
1919

2020
template<typename Shadow>
21-
bool update_deco_shadow(Shadow& impl, KDecoration2::Decoration* decoration)
21+
bool update_deco_shadow(Shadow& impl, KDecoration3::Decoration* decoration)
2222
{
2323
if (!std::visit(overload{[&](auto&& ref_win) {
2424
if (impl.m_decorationShadow) {
2525
// disconnect previous connections
2626
QObject::disconnect(
2727
impl.m_decorationShadow.get(),
28-
&KDecoration2::DecorationShadow::innerShadowRectChanged,
28+
&KDecoration3::DecorationShadow::innerShadowRectChanged,
2929
ref_win->qobject.get(),
3030
nullptr);
3131
QObject::disconnect(impl.m_decorationShadow.get(),
32-
&KDecoration2::DecorationShadow::shadowChanged,
32+
&KDecoration3::DecorationShadow::shadowChanged,
3333
ref_win->qobject.get(),
3434
nullptr);
3535
QObject::disconnect(impl.m_decorationShadow.get(),
36-
&KDecoration2::DecorationShadow::paddingChanged,
36+
&KDecoration3::DecorationShadow::paddingChanged,
3737
ref_win->qobject.get(),
3838
nullptr);
3939
}
@@ -47,15 +47,15 @@ bool update_deco_shadow(Shadow& impl, KDecoration2::Decoration* decoration)
4747
auto update_shadow = [ref_win]() { win::update_shadow(ref_win); };
4848

4949
QObject::connect(impl.m_decorationShadow.get(),
50-
&KDecoration2::DecorationShadow::innerShadowRectChanged,
50+
&KDecoration3::DecorationShadow::innerShadowRectChanged,
5151
ref_win->qobject.get(),
5252
update_shadow);
5353
QObject::connect(impl.m_decorationShadow.get(),
54-
&KDecoration2::DecorationShadow::shadowChanged,
54+
&KDecoration3::DecorationShadow::shadowChanged,
5555
ref_win->qobject.get(),
5656
update_shadow);
5757
QObject::connect(impl.m_decorationShadow.get(),
58-
&KDecoration2::DecorationShadow::paddingChanged,
58+
&KDecoration3::DecorationShadow::paddingChanged,
5959
ref_win->qobject.get(),
6060
update_shadow);
6161
return true;

como/render/effect/interface/effect_window.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <QObject>
1515
#include <QWindow>
1616

17-
namespace KDecoration2
17+
namespace KDecoration3
1818
{
1919
class Decoration;
2020
}
@@ -436,7 +436,7 @@ class COMO_EXPORT EffectWindow : public QObject
436436
* Returns the decoration
437437
* @since 5.25
438438
*/
439-
virtual KDecoration2::Decoration* decoration() const = 0;
439+
virtual KDecoration3::Decoration* decoration() const = 0;
440440
virtual QByteArray readProperty(long atom, long type, int format) const = 0;
441441
virtual void deleteProperty(long atom) const = 0;
442442

como/render/effect/window_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ class effects_window_impl : public EffectWindow
677677
*window.ref_win);
678678
}
679679

680-
KDecoration2::Decoration* decoration() const override
680+
KDecoration3::Decoration* decoration() const override
681681
{
682682
return std::visit(overload{[](auto&& ref_win) { return win::decoration(ref_win); }},
683683
*window.ref_win);

como/render/effects.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
2222
#include <como/render/gl/interface/framebuffer.h>
2323
#include <como/render/gl/interface/platform.h>
2424

25-
#include <KDecoration2/DecorationSettings>
25+
#include <KDecoration3/DecorationSettings>
2626

2727
namespace como::render
2828
{

como/render/effects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ class effects_handler_impl : public effects_handler_wrap
981981
// TODO: this could become per window and be derived from the actual position in the
982982
// deco
983983
auto deco_settings = get_space().deco->settings();
984-
auto close_enum = KDecoration2::DecorationButtonType::Close;
984+
auto close_enum = KDecoration3::DecorationButtonType::Close;
985985
return deco_settings && deco_settings->decorationButtonsLeft().contains(close_enum)
986986
? Qt::TopLeftCorner
987987
: Qt::TopRightCorner;

como/render/gl/shadow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class DecorationShadowTextureCache
8181
QSharedPointer<GLTexture> texture;
8282
QVector<Shadow*> shadows;
8383
};
84-
QHash<KDecoration2::DecorationShadow*, Data> m_cache;
84+
QHash<KDecoration3::DecorationShadow*, Data> m_cache;
8585
};
8686

8787
template<typename Window, typename Scene>

0 commit comments

Comments
 (0)