Commit graph

67 commits

Author SHA1 Message Date
Ivailo Monev
be70ca9e8c kdeui: use KKeyServer::keyQtToCodeX() for the key to keycode conversion in kGrabKey()
libhotkeys was using it and it does some tricks such as adding shift mod
for captical letters

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-14 02:30:14 +03:00
Ivailo Monev
9a996146af kdeui: check the filter pointer before using it in KGlobalAccel
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 17:25:56 +03:00
Ivailo Monev
c181a8e25c kdeui: do not log the action pointer when unsafe
generally because KGlobalAccel uses raw pointers it is unsafe to use the
KAction pointers for anything but comparison when removing/unregistering
from the KGlobalAccel destructor

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-07 02:30:48 +03:00
Ivailo Monev
9dfe6602a9 kdeui: pass the associated action from KKeySequenceWidget to KGlobalAccel
for better shortcut stealing, e.g. for actions with more than one
shortcut

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-27 04:49:06 +03:00
Ivailo Monev
a2f589fc43 kdeui: log a message when stealing global shortcut from KGlobalAccel::stealShortcutSystemwide()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-27 04:17:37 +03:00
Ivailo Monev
70feecedcf kdeui: add TODO for global shorcuts stealing
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-27 04:06:41 +03:00
Ivailo Monev
1faf138d4b kdeui: do not emit KAction::globalShortcutChanged() when the default changes or when the shortcut is set for the first time
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-26 01:06:36 +03:00
Ivailo Monev
d74d369e5e kdeui: simplify KActionCollection settings reading and writing
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-25 23:10:57 +03:00
Ivailo Monev
11e40bd6d2 kdeui: ungrab all shortcuts from KGlobalAccelPrivate::remove()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-25 10:34:58 +03:00
Ivailo Monev
3996fa22a7 kdeui: grab as many shortcuts as possible from KGlobalAccel
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-25 09:45:32 +03:00
Ivailo Monev
40d573ff43 kdeui: add XGrabKey and XUngrabKey references
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-25 07:24:32 +03:00
Ivailo Monev
18e2f7d037 kdeui: implement shortcut blocking for KGlobalAccel and use it in KKeySequenceWidget
obviously recording global shortcuts was borked

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-25 07:14:06 +03:00
Ivailo Monev
35e1c708d0 kdeui: remove redundant display check in KStandardShortcut initialization function
QKeySequence is not wired to GUI bits

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-25 06:13:57 +03:00
Ivailo Monev
667e1073f0 kdeui: steal the action global shortcut by setting it to empty QKeySequence and then removing it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-24 23:41:04 +03:00
Ivailo Monev
45ef26718a kdeui: emit globalShortcutChanged() from KAction
no way the grab failed or something other than KGlobalAccel grabs the
shortcut by force from KGlobalAccel, right?

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-24 23:37:43 +03:00
Ivailo Monev
cf229be24d kdeui: drop KCheckAccelerators
already have an idea about something like it but better

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-24 10:59:28 +03:00
Ivailo Monev
843463c95d kdeui: drop KSortcut
missing proper configuration interface for the shortcuts, the old one
was borked anyway

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-24 10:19:03 +03:00
Ivailo Monev
d725bcef69 kdeui: remove old KGlobalAccel autoloading feature leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-22 02:51:29 +03:00
Ivailo Monev
594e901c4a kdeui: rework KGlobalAccel
global shortcut resolution (the KGlobalAccel methods) work on
application level, X11 as far as I can tell does not have a method to
tell which application has grabbed a key (to fill KGlobalShortcutInfo).
other than that no configuration interface for global shortcuts (not by
KGlobalAccel itself, plasma and its applets have interface for that),
also the shortcuts interface did not and still does not handle global
shortcuts well so that is something to look into.

one of the problems solved with this change is the fact that multiple
plasma applets (e.g. multiple instances of the keyboard applet) could
not use the same shortcut, now it is possible. as for which applet gets
the shortcut action it is the one that has the grab first - that is how
key grabbing works in X11

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-22 00:07:35 +03:00
Ivailo Monev
5d12e973e6 kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 20:45:47 +03:00
Ivailo Monev
048737d48c kdeui: remove bogus bits in KAction::setGlobalShortcut()
the keycode for invalid shortcuts (QKeySequence) is zero, the key could be
zero if alternative shortcut is not set and there is only primary shortcut.
also, Katie's QKeySequence supports only two key combinations now - one for
primary and one for alternative, see the following commit in the Katie
repo:
d03db175529e800f62acd858badb5622be2e00af

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 17:23:59 +03:00
Ivailo Monev
7339f85e8c kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 07:20:24 +03:00
Ivailo Monev
2bf47096e8 kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 07:08:35 +03:00
Ivailo Monev
00b7fdfe54 kdeui: remove unused INCLUDE_MENUITEM_DEF definition
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-30 06:28:52 +03:00
Ivailo Monev
e978590acd generic: define KDE_DEFAULT_DEBUG_AREA in the main build file for each library
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-09 23:43:20 +03:00
Ivailo Monev
871151e83c generic: remove QT_KATIE definition checks
only Katie is supported now

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-08 14:38:36 +03:00
Ivailo Monev
2d2c71065c kdeui: somewhat format kacceleratormanager source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-23 05:06:12 +03:00
Ivailo Monev
6784f51d58 kdeui: tweak KNotificationManager and KGlobalAccel for automatic service activation
KGlobalAccelPrivate uses service watcher and the interface is invalid until
the service is activated (either by the first call of the interface or some
other lazy-initialization method), however KNotificationManager does
connect to signals immediately (which should work regardless) but the error
may have been logged before

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-09 12:00:23 +02:00
Ivailo Monev
a1951cfbae kdeui: reuse the already created interface in KGlobalAccelPrivate::getComponent()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-09 11:37:02 +02:00
Ivailo Monev
0e980c95cc kdeui: remove redundant attempts to start D-Bus services
creating QDBusInterface should start the services, in case the services
cannot be started tho delays may be experienced (such as the UI freezing
while waiting for D-Bus reply to finish) thus logging error

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-09 03:40:07 +02:00
Ivailo Monev
442a016f0a kdeui: correct debug messages area code
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-22 20:25:57 +03:00
Ivailo Monev
5a3d2fbac3 kdeui: use I18N_NOOP2_NOSTRIP() macro instead of redefining I18N_NOOP2()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-02 00:12:37 +03:00
Ivailo Monev
ab8812764a kdeui: move the default value for KGlobalAccelPrivate::getComponent() argument to the method declaration
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-30 01:25:48 +03:00
Ivailo Monev
d7e21d5d57 kdeui: effectively revert c689f83d30
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 11:13:25 +03:00
Ivailo Monev
7c996527a8 kdeui: remove declaration of non-existing KShortcutSchemesHelper::saveShortcutScheme() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 10:57:59 +03:00
Ivailo Monev
ec0b9543aa kdeui: remove unused KGlobalAccelPrivate members
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 10:51:08 +03:00
Ivailo Monev
9cf5779647 kdeui: call QObject constructor in the default KGlobalShortcutInfo constructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 10:48:29 +03:00
Ivailo Monev
c689f83d30 kdeui: remove KGlobalShortcutInfo friend declaration for non-existing class
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 10:46:46 +03:00
Ivailo Monev
fe76fe95a7 kdeui: optimize KGlobalShortcutInfo assignment operator
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 10:29:07 +03:00
Ivailo Monev
5e44389ef6 kdeui: fix build by using non-deprecated org.kde.KGlobalAccel interface method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-26 19:08:29 +03:00
Ivailo Monev
0a26ba0d92 kdeui: org.kde.KGlobalAccel D-Bus interface file update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-26 18:58:06 +03:00
Ivailo Monev
d05992bda9 kdeui: drop gesture support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-21 04:41:08 +03:00
Ivailo Monev
ee0cf764c3 kdeui: indent standard shortcuts table
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-06-03 00:47:27 +03:00
Ivailo Monev
d0a946485b kdeui: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-06-03 00:39:46 +03:00
Ivailo Monev
609dc64f8a kdeui: fix on-demand starting of kuiserver, knotify4 and kglobalaccel services
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-05-23 21:24:47 +03:00
Ivailo Monev
e063e7a6f4 generic: remove Qt support leftovers [ci reset]
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-05-12 04:13:26 +03:00
Ivailo Monev
2f9251dcb8 kdeui: remove unused object in hardcodedDefaultShortcut()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2021-02-27 17:35:37 +02:00
Ivailo Monev
56e3b24d36 kdeui: prepare for Katie changes
note that button 4 and 5, which are mouse wheel buttons, are mapped to
wrong buttons in KModifierKeyInfoProvider constructor

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2021-02-18 21:40:31 +02:00
Ivailo Monev
009238d4c3 kdeui: remove redundant qmenudata header inclusion
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
2020-04-02 09:25:08 +00:00
Ivailo Monev
05c4419b77 generic: replace obsolete Qt::MidButton with Qt::MiddleButton
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
2019-05-07 17:16:57 +00:00