Commit graph

170 commits

Author SHA1 Message Date
Ivailo Monev
d03b3a3f47 kdeui: do not create startup ID from KToolInvocation
KToolInvocation does not check if the application/service that is to be
started actually supports startup notification, it is done by KLauncher and
KRun tho (as it should be)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-03 01:46:51 +03:00
Ivailo Monev
1969c7c22a kdeui: drop bogus multihead support
tottaly a hack, restoring applications on specific display will not work
either (not as long as it is possible to start session on any display, i.e.
restoring on specific display is unreliable)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-01 16:19:18 +03:00
Ivailo Monev
387bdaa93f generic: drop support for BrowserApplication config option
browser shall be determinted by the preferred service for "text/html",
"application/xhtml+xml" or any other MIME type for it (that includes
scheme handlers)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-31 21:22:56 +03:00
Ivailo Monev
9338606754 kdeui: fix possible double-free in KApplicationPrivate::parseCommandLine()
could happen only if "waitforwm" command line argument was passed and there
was no window manager

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 15:11:56 +03:00
Ivailo Monev
37a2c8db4a kdeui: implement option to select any standard sound file for notifications
because the old KNotification implementation did not look for sounds
recursively it was not possible to set a relative sound file that is
supposed to not be in one of the main sound directories (e.g a sound in a
sub-directory like /usr/share/sounds/freedesktop/stereo/message.oga, for
such files the full path had to be set in the notification config but no
more)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 07:55:22 +03:00
Ivailo Monev
8b3009ac6a kdeui: fix KApplication status notifier item actions shortcut conflict
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-24 15:43:03 +03:00
Ivailo Monev
4b632fcae6 kdeui: implement status notifier for any KApplication instance
optional feature that requires "-tray" command line argument and replaces
what the `ksystraycmd` program was doing. requires "X-KDE-SysTray" entry
in the desktop file as indicator that the application supports "-tray"
argument, unlike `ksystraycmd` does not spawn extra process and even
session management will work properly for it (the argument is manually
added to the restart command)

the feature is very much tide to KMainWindow (and derived classes) but the
overhead is next to none when the "-tray" argument is not specified (the
status notifier is not created in such case) however if created an
expensive tooltip update is done whenever a window changes (may have to
look into optimizing it but then again - most of the code does nothing
unless the "-tray" argument is specified)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-24 01:41:02 +03:00
Ivailo Monev
35d700e9b6 kdeui: assume that the platform plugin has set the starting drag distance
the default of the platform plugin is QApplication::startDragDistance() too

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 05:01:28 +03:00
Ivailo Monev
7408814734 kdeui: cache some fonts via QApplication
bonus points for setting fixed font for QTextEdit and QPlainTextEdit by
default

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 04:42:50 +03:00
Ivailo Monev
58dfa5c884 kdeui: keep reference to the QByteArray object in x11SetCursorName() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-22 05:44:17 +03:00
Ivailo Monev
b4657deb95 kdeui: new KGlobalSettings signal and enum for global config change
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-22 04:28:15 +03:00
Ivailo Monev
24f8640acd kdeui: simplify KGlobaSettings and do not setup mouse from it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-22 23:32:43 +07:00
Ivailo Monev
948a17ffb0 kdeui: partially revert 3dbd7b1da9
lots of work to be done on that one so for now just apply the palette

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-22 08:48:21 +07:00
Ivailo Monev
3dbd7b1da9 kdeui: do not apply style and palette from KGlobalSettings
palette and style shall be applied by the platform plugin, the font is
independant of the full Katana session (look for
KGlobalSettings::generalFont() for example, font from config is used here
and there because the config and thus KGlobalSettings offer fine grained
font selection for different purposes)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 17:42:31 +03:00
Ivailo Monev
c1015be8c8 kdeui: remove reference to non-existing kDebugCleanup() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 16:51:53 +03:00
Ivailo Monev
791e27f106 kdeui: sync getKLauncherError() with KLauncher
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 16:46:08 +03:00
Ivailo Monev
a68302abc1 kdeui: do not change the cursor theme from KGlobalSettings
in full Katana session it is done by the input KCM and even by the
`startkde` script (so that cursor theme applies for any error messages
shown via `xmessage`). as for changing after startup it is again done by
the input KCM (via `XFixesChangeCursorByName()` calls and other stuff), the
change even applies when not in Katana session (i.e. `systemsettings`
changes the cursor theme even if not in Katana session) so it is redundant
to do it from KGlobalSettings and only the notification signal has to be
emitted

on a side note style and palette are applied by the platform plugin (see
kde-workspace/qguiplatformplugin_kde/qguiplatformplugin_kde.cpp) when in
full Katana session meaning style and palette also do not have to
applied by KGlobalSettings but that is for another commit because there
are some other things to take in account (such as style override via
command line argument and initializing plugin paths early, before
KApplication is constructed)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 16:28:01 +03:00
Ivailo Monev
73717efd83 kdeui: apply double-click, drag, scroll, etc. settings on KGlobalSettings::SETTINGS_MOUSE notification
the input KCM (which changes mouse settings) emits that change so it makes
sense to apply mouse-related settings to the application when it is
emitted. also notfication for KGlobalSettings::SETTINGS_QT was never
emitted

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 16:18:06 +03:00
Ivailo Monev
6ace1d4cae kdeui: KGlobalSettings and KApplication friendship has been broken
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 16:14:38 +03:00
Ivailo Monev
0dd60b4e64 kdeui: deal with TODO related to KGlobalSettings::activate()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 16:02:41 +03:00
Ivailo Monev
ee6cd48109 kdeui: remove unused KGlobalSettings::SettingsCategory::SETTINGS_POPUPMENU enum
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 15:53:07 +03:00
Ivailo Monev
762d5413a0 generic: change the home, bug report and help URLs
fortunately I've made it that easy

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-20 20:01:46 +03:00
Ivailo Monev
1d2947b476 kdeui: KStartupInfoId::timestamp() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-20 01:02:48 +03:00
Ivailo Monev
a50c72de91 generic: drop support for startup notification via D-Bus service
just another way to do what ASN does, the KService::DBusWait mode was
not used too. with this change however all of the process setup code is
moved to a seperate class and the responsibility of KLauncher about ASN
is reduced (ASN now works better for process that fork but if application
claims ASN support and does not send ASN finish then the timeout will be
reached)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-19 19:53:14 +03:00
Ivailo Monev
32ac1e19f9 kdeui: drop now redundant KApplication hack
see the following commit in the Katie repo:
198625f679aabbe25097884ec0029bc55e0a84b8

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-19 00:40:20 +03:00
Ivailo Monev
09763a2377 kdeui: create the _NET_SUPPORTED atom on demand
fixes the "waitforwm" command line option
(KApplicationPrivate::parseCommandLine() was called before the X11 atom was
created and atom was invalid) and doubles as optimization

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-19 00:27:11 +03:00
Ivailo Monev
d278c3c63c kdeui: new KDE_DEFAULT_CURSOR_THEME
to make it easy to change the default

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-15 02:38:45 +03:00
Ivailo Monev
d41b63de00 kdeui: initialize KUniqueApplication::Private member in the constructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 11:49:05 +03:00
Ivailo Monev
c0379cc431 kdeui: remove unused KGlobalSettings methods
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 11:46:24 +03:00
Ivailo Monev
bd063c8b56 generic: remove dead and irrelevant links references
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-10 14:26:19 +03:00
Ivailo Monev
be9d8967f7 kdeui: remove redundant KGlobalSettings::desktopGeometry() methods
QDesktopWidget is Xinerama aware and it can be disabled because I
implemented option for that, see the following commit in the Katie repo:
b7e4bae65f0cae7f3029b98980f638c077ecfc22

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-09 03:58:14 +03:00
Ivailo Monev
0f7d9f8ea3 kdecore: setup KCrash to log to the system log, update its documentation
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-04 11:51:35 +03:00
Ivailo Monev
7d088288c2 kdeui: remove redundant X11 atoms creation from KApplicationPrivate::init()
XdndDrop is already created by QApplication for internal purposes,
KDE_DESKTOP_WINDOW is a bogus one

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 08:32:37 +00:00
Ivailo Monev
899f789b07 kdecore: move KToolInvocation to kdeui
to get rid of the KApplication signal which is a hack really

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 08:09:02 +00:00
Ivailo Monev
eebedd4c76 kdeui: send locale and language change events from KGlobalSettings
the signals come from the locale KCM however applications, libraries and
widgets handling of such changes is mixed - some do it on
QEvent::LocaleChange, some on QEvent::LanguageChange, some when the
KGlobalSettings signal is send so sending the events will make sure that
locale changes take effect immediatly (when and wherethe event is watched
for ofcourse, KCalendarWidget does it for one)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-29 07:55:01 +03:00
Ivailo Monev
7c2e6741b6 kdeui: remove redundant Q_WS_X11 guard
KStartupInfo is not declared only when Q_WS_X11 is defined, altough it
works only on X11

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 19:14:02 +03:00
Ivailo Monev
abbf3f3930 kdeui: call KUniqueApplication::newInstance() on the interface when already running
so it was not called when "nofork" option was passed? hmm..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 19:10:45 +03:00
Ivailo Monev
e583beafbf kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 18:10:23 +03:00
Ivailo Monev
cd8ab8d93e kdeui: do not fork from KUniqueApplication
simplifies startup notification for example, external applications that
pass the "nofork" argument may fail (not uncommon to be passed to
konsole)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 17:32:37 +03:00
Ivailo Monev
0e56bc6115 kdeui: remove unused KApplicationPrivate member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 16:48:12 +03:00
Ivailo Monev
982f2446bb kdeui: remove unused clipboard synchronizer
disabled by default, the KGlobaSettings signal is not emitted by
anything either

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 06:44:40 +03:00
Ivailo Monev
e5f56675d2 generic: call QCoreApplication::applicationName() as static method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-19 01:19:01 +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
6f78051c91 kdecore: implement option to download the icon from KMimeType::favIconForUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-05 08:18:03 +03:00
Ivailo Monev
53fda3a2f6 kdeui: remove the unused and non-standard LAUNCHED_BY ASN info
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-21 05:23:54 +03:00
Ivailo Monev
c778105bde kdeui: format and indent kglobalsettings source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-01-02 00:26:14 +02:00
Ivailo Monev
6b477ad3dc kdeui: merge KGlobalSettingsData into KGlobalSettings::Private
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-01-01 20:48:04 +02:00
Ivailo Monev
e3117700d8 kdeui: remove unused KGlobalSettings::allowDefaultBackgroundImages() method
unused, no GUI to disable/enable it and palettes use colors (altough QBrush
can hold a texture)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-01-01 20:02:17 +02:00
Ivailo Monev
7a67866279 kdeui: read the mouse button mapping from the correct config
the mouse KCM stores the value in kcminputrc, not kdeglobals

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-01-01 19:48:10 +02:00
Ivailo Monev
58798988c1 kdeui: minor KApplication documentation correction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-23 20:27:49 +02:00