Commit Graph

367 Commits

Author SHA1 Message Date
Ilya Fedin
e0b4d1edce Avoid unneeded std::string casts in exception handling 2023-09-20 17:45:37 +04:00
Ilya Fedin
ea41aab713 Make use of templated XDP::ReadSetting 2023-09-18 19:52:48 +04:00
Ilya Fedin
8ea4f26e31 Simplify some using-s 2023-09-17 19:54:54 +04:00
Ilya Fedin
0b4a255acc Use SNAP_INSTANCE_NAME in SingleInstanceLocalServerName
That's what snapd's apparmor profiles use
2023-09-14 09:27:13 +04:00
Ilya Fedin
dfa5386a27 Ensure closing is supported for running in background 2023-09-12 19:49:48 +04:00
Ilya Fedin
e946bf5338 Run in background on Linux when minimization is not supported 2023-09-12 10:27:13 +04:00
Ilya Fedin
e52e1672e8 Make PortalAutostart asynchronous 2023-09-11 11:11:40 +04:00
Ilya Fedin
55fb3405e5 Move feature warnings to the relevant code 2023-09-11 11:05:05 +04:00
Ilya Fedin
0079a18e97 Call D-Bus ReloadConfig asynchronously 2023-09-04 18:11:25 +04:00
Ilya Fedin
396635fa1d Make use of the new window-less base::Platform::XDP::ParentWindowID 2023-08-25 10:21:25 +02:00
Ilya Fedin
0e3e0c5b81 Do a D-Bus request instead of systemctl command for D-Bus config reload 2023-08-03 18:14:17 +04:00
Ilya Fedin
272d2da04a Stabilize app id on Linux when -workdir is set to the default workdir
Currently the app id hash is generated from workdir path only when it's set explicitly and that's for a good reason: the default workdir could be changed (e.g. by creating a TelegramForcePortable) and app id would change what would result in a duplicate .desktop created.

The current code has the possibility of having duplicate .desktop files, too, as it happened, but by specifying -workdir to the same directory as the default one.

There's now a check that ensures the specified workdir is really custom so those duplicate launchers could be removed what should really stabilize the hash.
2023-07-24 10:37:38 +04:00
Ilya Fedin
30c73fbdf2 Fix D-Bus service with non-standard workdir or backslash in the path
Working dir not set leads to unrelevant instance being launched with unrelevant bus name and entire launchf fails.

D-Bus service files also don't need backslash escaping unlike the .desktop files.
2023-07-21 17:53:24 +04:00
Ilya Fedin
9ccb11bd1a Avoid using const_string for constant consumed by std::string 2023-07-20 21:39:06 +04:00
Ilya Fedin
f817df9d7f Use new glibmm 2.78 API 2023-07-20 17:58:07 +04:00
Ilya Fedin
0534a2fb62 Fix QGuiApplication::desktopFileName usage
The Qt documentation says:
This is the file name, without the full path or the trailing ".desktop" extension of the desktop entry that represents this application according to the freedesktop desktop entry specification.

Qt 6.5.2 also automatically fixes it breaking all the current tdesktop and desktop-app usage expecting the file extension.
2023-07-19 23:51:50 +04:00
Ilya Fedin
2dfe858327 Support D-Bus activation 2023-07-01 21:05:42 +04:00
Ilya Fedin
0421e41c47 Check actual executable path instead of cExeName in GenerateDesktopFile 2023-07-01 21:05:42 +04:00
Ilya Fedin
1d234ea990 Use argv0 for shortcuts when updater is disabled 2023-06-16 11:38:54 +04:00
Ilya Fedin
074c725c6c Move Platform::ThirdParty::start content to LinuxIntegration 2023-06-13 12:19:21 +04:00
Ilya Fedin
a7bd097b2f Have a global Core::Launcher accessor
This allows to use Launcher in code executing before Sandbox is created
2023-06-13 12:19:21 +04:00
Ilya Fedin
6aef6d7f4e Integrate GApplication with QFileOpenEvent and Core::Application::activate 2023-05-29 10:51:40 +04:00
John Preston
f46f655a0e Revert "Disable xcb_xlib"
This reverts commit d1ff6e583d.

Otherwise HIME input is broken:
https://github.com/telegramdesktop/tdesktop/issues/26228
2023-05-24 18:11:36 +04:00
Ilya Fedin
0ffaff2d8b Support Qt 6.5 dark mode API 2023-05-15 12:33:30 +04:00
Ilya Fedin
0b4ebcbae4 Warn if incompatible event loop is detected 2023-05-15 08:08:04 +04:00
Ilya Fedin
0a011db483 Get rid of DESKTOP_APP_DISABLE_DBUS_INTEGRATION
Desktop App Toolkit uses GLib as the D-Bus library for quite long time, but GLib is not only a D-Bus library, it's more a basic library providing native Linux APIs implementing various specs. The situation right now is that DESKTOP_APP_DISABLE_DBUS_INTEGRATION disables not only D-Bus code but all the native API integration such as MIME handling or .desktop file parsing. In other words, the option disables native Linux APIs on Linux what is absurd and doesn't have any sense.
2023-05-15 08:08:04 +04:00
Ilya Fedin
c78a15410d Try to remove Wayland blacklist again 2023-04-03 19:44:52 +04:00
Ilya Fedin
d1ff6e583d Disable xcb_xlib 2023-04-03 13:33:37 +04:00
Ilya Fedin
d52cabb386 Update to the new WebKitGTK 6.0 API 2023-04-02 17:19:15 +04:00
Ilya Fedin
e632ac631e Add version check for abstract sockets 2023-04-02 00:06:04 +04:00
Ilya Fedin
3064a41014 Try to restore updater-dependent binary path logic
Now that the file generating logic is simplier, it may be not that hard to maintain
2023-04-02 00:06:04 +04:00
Ilya Fedin
30f057fff5 Use abstract socket for single instance on Linux 2023-04-01 00:17:58 +04:00
Ilya Fedin
96cced8401 Make the quit action lowercase
Just like other GApplciation actions
2023-03-09 11:16:11 +04:00
Ilya Fedin
c5acef8c53 Deduplicate notification actions on Linux
As there are notification daemons with quick reply support and GNotification API having mandatory default action support now, it's the time to reconsider button arrangement.

This also makes it possible for legacy notification daemons without default action support opening the chat when no buttons are allowed since 05524c3f6c again.
2023-03-02 17:33:06 +04:00
John Preston
aa9e56c633 Update icon on macOS, allow changing back. 2023-03-01 09:12:02 +04:00
Ilya Fedin
f71e7812e6 Don't hold GApplication
That's a much better way to avoid defunct event loop that will work in any edge case

Also don't assume GApplication is always running in Platform::Notifications::Enforced
2023-02-18 20:33:40 +04:00
Ilya Fedin
e78975d770 Fix event loop for non-first instance on Linux 2023-02-17 09:27:36 +04:00
Ilya Fedin
2be4641496 Install launcher on every launch on Linux
Just like AppUserModelId on Windows

This makes the cheat code and having the function outside of private namespace unnecessary
2023-01-23 12:16:59 +04:00
Ilya Fedin
b62e1d5036 Set prgname and application name before glibmm initialization
This ensures possible warnings use right process name
2023-01-22 15:11:02 +04:00
John Preston
7023b013ce Initial support of separate windows for accounts. 2023-01-19 09:45:28 +04:00
Ilya Fedin
9b7826ea0d Get GApplication out of experimental settings
GApplication will always be used on Linux now. GNotification gets a toggle instead.
2023-01-12 21:30:45 +04:00
John Preston
c49dac57b7 Don't use window title for IPC. 2023-01-09 16:08:34 +04:00
Ilya Fedin
c56977cbc1 Check autostart enabling success on Linux 2023-01-02 13:10:17 +04:00
Ilya Fedin
a3caecbc07 Fix build with clang 2022-12-29 09:32:07 +04:00
Ilya Fedin
ecd217a79f Implement autostart in snap 2022-12-20 18:55:29 +04:00
Ilya Fedin
4aa9c1fea3 Get saving desktop file out of group loop 2022-12-20 18:55:29 +04:00
Klemens Nanni
9c27271571 Use std::invoke_result_T not ::result_of to fix C++20 tdesktop 4.3.4
tdesktop defaults to (probably requires) C++20, but `std::result_of`[0]
was deprecated in C++17 and removed in C++20.

0: https://en.cppreference.com/w/cpp/types/result_of
2022-12-09 09:12:34 +04:00
Ilya Fedin
5990b0fabf Fix build with Qt 5 2022-12-08 10:15:59 +04:00
Ilya Fedin
6f50906952 Don't use unneeded QEventLoop::ApplicationExec 2022-12-07 11:27:49 +04:00
23rd
4fabb3f2a2 Replaced some qsl with u""_q literal. 2022-11-30 17:17:14 +03:00