Ilya Fedin
4807244682
Don't use crl::on_main unnecessarily with XDP::SettingWatcher
...
g_dbus_connection_signal_subscribe calls the callback on the same thread
2023-09-04 16:21:58 +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
4755be4ace
Add missing returns to skip taskbar Linux abstraction
2023-08-24 11:44:06 +02:00
Ilya Fedin
07bbfd1353
Make dark mode update go through Qt code on Linux
...
This makes the behavior consistent and is possible now thanks to a Qt patch
2023-08-18 17:09:21 +02:00
Ilya Fedin
12eed5f433
Get optional string support in cppgir
2023-08-10 19:33:01 +04:00
Ilya Fedin
c2e96db358
Fix a typo in the LinuxIntegration event dispatcher warning
2023-08-06 21:20:10 +04:00
Ilya Fedin
1cad1966f7
Try to instantiate GApplication instance without nested event loop
2023-08-06 21:20:10 +04:00
Ilya Fedin
8669e6a891
Port GApplication to cppgir
2023-08-06 21:20:10 +04: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
da55698a51
Generate GUID for GNotification
...
That's what g_application_send_notification does when ID is not passed and that simplifies the code
2023-08-03 18:12:55 +04:00
Ilya Fedin
cf781e1043
Port AppLaunchContext to cppgir
2023-08-03 18:11:31 +04:00
John Preston
8ec0bdcac9
Version 4.8.10: Fix build with GCC.
2023-07-28 21:46:41 +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
3cb49127f4
Make a weak pointer for GApplication startup lambda
...
Or it never gets destroyed
2023-07-21 06:48:57 +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
a3cdf19c1f
Ensure Wayland integration instance accessor doesn't leak
2023-06-17 15:13:31 +04:00
Ilya Fedin
1d234ea990
Use argv0 for shortcuts when updater is disabled
2023-06-16 11:38:54 +04:00
Ilya Fedin
8aee08eaef
Track argv0 through relaunches
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
af00247362
Provide access to un-joined argument list in Core::Launcher
...
This allows to re-use the variable in Linux-specific code
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
71570f5be1
Store managed objects inside managers
2023-05-30 20:55:15 +04:00
Ilya Fedin
8c38d31950
C++ify wl_registry
2023-05-30 20:55:15 +04:00
Ilya Fedin
2ce9e610fa
Update icons when icon theme on Linux changes
2023-05-29 11:07:19 +04:00
Ilya Fedin
6aef6d7f4e
Integrate GApplication with QFileOpenEvent and Core::Application::activate
2023-05-29 10:51:40 +04:00
Ilya Fedin
54841de991
Use new base_linux_wayland_utilities
2023-05-25 22:05:13 +04:00
Ilya Fedin
fc66a0eea8
Destroy Wayland integration before Wayland disconnection
2023-05-25 22:05:13 +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
9514b0d1f1
Get rid of unneeded gi::result wrap
2023-05-19 15:33:43 +04:00
Ilya Fedin
2ea50f5c85
Constify options in Linux screen locker monitor
...
That's possible now thanks to cppgir update
2023-05-19 15:33:43 +04:00
Ilya Fedin
d1455f5117
Switch Wayland integration to the new type safe Qt API
...
This also makes object lifetime tracking better thanks to the new API
2023-05-15 12:34:56 +04:00
Ilya Fedin
0ffaff2d8b
Support Qt 6.5 dark mode API
2023-05-15 12:33:30 +04:00
Ilya Fedin
2675b5df3b
Use QGuiApplication::setBadgeNumber API since Qt 6.6 on Linux
2023-05-15 10:20:18 +04:00
Ilya Fedin
db60bee7dc
Implement screen locker monitor on Linux
2023-05-15 09:51:13 +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
8dee2a1c8b
Set device pixel ratio for counter layer
2023-04-04 10:07:51 +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
ae93455101
Update glibmm to 2.76.0
2023-03-17 18:56:23 +04:00
John Preston
32e650548f
One more attempt to fix DND on macOS.
2023-03-15 15:00:29 +04:00
Ilya Fedin
8975a31597
Optimize system tray icon cache invalidation
2023-03-09 11:16:35 +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
John Preston
c09043f827
Fix build for macOS.
2023-02-18 15:10:14 +04:00
John Preston
832d47121f
Save media viewer position to Settings.
2023-02-18 15:10:13 +04:00
John Preston
f9847090f9
Cmd+Q quit prevention in windowed media viewer.
2023-02-18 15:10:13 +04:00
John Preston
2a1e3c4453
Initial implementation of windowed media viewer on macOS.
2023-02-18 15:10:13 +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
Ilya Fedin
6f89413c76
Don't get cursor position twice for open with menu
2023-01-20 12:58:48 +04:00
John Preston
e4c16ccba4
Create tray icon without a parent.
2023-01-19 09:46:19 +04:00
John Preston
7023b013ce
Initial support of separate windows for accounts.
2023-01-19 09:45:28 +04:00
Ilya Fedin
9b154b3c91
Ensure freedesktop capabilities aren't used when GNotification is used
2023-01-13 10:24:06 +04:00
Ilya Fedin
a1f9b5a96f
Get GApplication out of experimental settings
...
GApplication will always be used on Linux now. GNotification gets a toggle instead.
2023-01-12 21:49:16 +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
fc26457218
Show current chat name in the window title.
2023-01-09 18:39:07 +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
1666683dbb
Fix various line length in notifications_manager_linux
2022-12-29 12:30:17 +04:00
Ilya Fedin
c134861cd9
Have notification subtitle in title on Linux when body-markup is not supported
...
This makes it look way better
2022-12-29 12:30:17 +04:00
Ilya Fedin
a3caecbc07
Fix build with clang
2022-12-29 09:32:07 +04:00
Ilya Fedin
13eeddf479
Don't wait for input when there are fullscreen applications
2022-12-23 14:04:17 +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
Ilya Fedin
b3e547f4dd
Fix a warning in snap build
2022-12-16 11:03:37 +04:00
Ilya Fedin
3cb333d323
Fix counter paint when DPR != 1 in Linux tray
2022-12-09 16:04:07 +04:00
Ilya Fedin
2565b948d9
Cache system icon in Linux tray
2022-12-09 16:04:07 +04:00
Ilya Fedin
577f4b6271
Don't check com.canonical.Unity for the counter
...
It seems there's a race condition when Telegram is auto-started on Plasma and it doesn't hurt to issue the signal always, so just remove the check
2022-12-09 09:19:00 +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
John Preston
8937d732f6
Fix build with GCC.
2022-12-06 18:08:07 +04:00
John Preston
48148a8cc3
Revert "Provide the same sizes for tray icon as for main window icon"
...
This reverts commit f9bf68461d
.
2022-12-06 12:55:09 +04:00
John Preston
cb653df0f6
Support adaptive forum userpic rounding radius.
2022-12-05 16:18:10 +04:00
23rd
4fabb3f2a2
Replaced some qsl with u""_q literal.
2022-11-30 17:17:14 +03:00
John Preston
ad3f8e72a0
Remove namespace App.
2022-11-30 17:28:09 +04:00
23rd
2acedca6b7
Replaced some qstr with u""_q literal.
2022-11-29 14:12:50 +03:00
Ilya Fedin
05524c3f6c
Don't show reply button in Linux native notifications when it's not supposed to
...
All modern notification daemons have support for the default action and it's a requirement with the portal spec
2022-11-28 21:55:00 +01:00
Ilya Fedin
b383dad6ac
Install launcher before registering URL scheme
2022-11-28 12:12:09 +01:00
Ilya Fedin
2bda3c4e2b
Don't save temp file for native notification userpics on Linux
2022-11-26 22:15:39 +01:00
Ilya Fedin
4484edd212
Get rid of unneeded QTextStream from GenerateDesktopFile
2022-11-26 17:26:52 +01:00
Ilya Fedin
ace363f432
Use GBytesIcon with GNotification
...
GFileIcon is not supported by xdg-desktop-portal
2022-11-26 17:26:52 +01:00
Ilya Fedin
d6ed23b3dd
Fix race condition between GApplication and GNotification
2022-11-26 17:26:52 +01:00
Ilya Fedin
9ee4ad95d0
Fix GApplication with some binary paths
2022-11-26 17:26:52 +01:00
Ilya Fedin
4ade80905f
Add proper build-time checks to AutostartSupported on Linux
2022-11-26 17:26:52 +01:00
Ilya Fedin
94b4809cdf
Get XDG activation token also from DESKTOP_STARTUP_ID
2022-11-25 15:11:25 +01:00
Ilya Fedin
109f6614f0
Unset XDG_ACTIVATION_TOKEN after used with GApplication
2022-11-25 15:11:25 +01:00
Ilya Fedin
a94dd22caa
Rewrite GenerateDesktopFile using Glib::KeyFile and KShell
2022-11-21 21:30:17 +00:00
Ilya Fedin
899ab9a16a
Fix range loop warnings in Snap build
2022-11-21 21:30:17 +00:00
Ilya Fedin
2f0d14bd35
Use customWorkingDir() outside of Core::Launcher
...
This allows to add -workdir to shortcuts only if the process was launched with -workdir
2022-11-21 21:30:17 +00:00
Ilya Fedin
9b66b76bac
Use GNotification only in flatpak by default
...
The UX is not the best without sound, so there's no advantage in using GNotification on GNOME.
Remove mention about being native to GNOME as it's not true anymore.
2022-11-20 08:52:36 +00:00
Ilya Fedin
a1e60a3f20
Ensure GNotification is not autodetected in snap
...
Snap reports it as present, but prevents the access and GNotification attempts to use portal that doesn't work in snap
2022-11-19 02:21:51 +04:00
Ilya Fedin
768fc9b8f6
Use the new Glib::Variant qint64/quint64 compatibility with old code
2022-11-18 20:40:33 +04:00
Ilya Fedin
b9b6a9e747
Follow desktop file naming specification
...
This is required for GApplication to enable all the features
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#file-naming
2022-11-18 20:40:33 +04:00
Ilya Fedin
b4d310fd1e
Don't subscribe to inhibiton changes when not supported
2022-11-18 20:40:33 +04:00
Ilya Fedin
f9dd2b4a0a
Support GNotification
...
It's used if there's a gtk notification daemon or application is running sandboxed without access to the freedesktop protocol.
GNotification API is poor, but should feel native on environments using GNOME technologies.
2022-11-18 20:40:33 +04:00
Ilya Fedin
9726b3c298
Avoid race condition when registering Wayland interfaces
2022-11-11 11:47:01 +04:00
Ilya Fedin
f542a026ec
Add _GTK_APPLICATION_ID support
2022-11-07 18:16:49 +04:00
Ilya Fedin
fc4682d77e
Get rid of TDESKTOP_LAUNCHER_BASENAME
...
This key was mainly used to let flatpak and snap provide right desktop file name.
Now, we can compute it from the environment in runtime for both flatpak and snap.
There's no more need in this option. Desktop filename override by downstreams is highly discouraged.
2022-11-07 13:47:58 +04:00
Ilya Fedin
a507edb67a
Get rid of workarounds for old flatpak versions
...
The minimal supported flatpak version since Qt 6.x is 1.14.0.
Flatpak shares temp directory and runtime directory between launches since 1.11.1.
FLATPAK_ID is defined since 1.1.2.
2022-11-07 13:47:58 +04:00
Ilya Fedin
1336a7149b
Update glibmm to latest version
2022-11-03 14:45:01 +04:00
Ilya Fedin
ba9f5d138a
Use some APIs from newer glibmm
2022-11-02 21:02:46 +04:00
John Preston
fdf4129e5e
Fix build with GCC.
2022-11-02 08:51:03 +04:00
John Preston
92a4b27e65
Support per-topic notification settings.
2022-11-01 19:25:37 +04:00
Ilya Fedin
f9bf68461d
Provide the same sizes for tray icon as for main window icon
2022-10-16 18:04:07 +04:00
Ilya Fedin
2d69329dc9
Set linux webview debug mode via D-Bus IPC
2022-10-03 09:29:25 +04:00
Ilya Fedin
2a6e2fa353
Bundle kcoreaddons
2022-09-28 23:59:59 +04:00
Ilya Fedin
f2d2826fc7
Make InstallLauncher accessible on any platform
2022-09-19 14:23:27 +04:00
Ilya Fedin
cfa12fb0cc
Move AppRuntimeDirectory to private namespace
2022-09-19 14:23:27 +04:00
Ilya Fedin
d9318c9935
Move icon name getter to cross-platform header
2022-09-19 14:23:27 +04:00
Ilya Fedin
5132fd5010
Use KSandbox to check flatpak/snap environment
2022-09-19 14:23:27 +04:00
Ilya Fedin
89879e355d
Replace EscapeShell with KShell::joinArgs
2022-09-19 14:20:02 +04:00
Ilya Fedin
88f1f8ff22
Move QGuiApplication::setDesktopFileName call to Platform::start
...
It depends on Core::UpdaterDisabled that is not initialized in Launcher::initHook yet
2022-09-05 08:24:48 +04:00
Ilya Fedin
feb6107ce6
Qt 6.4 supports window activation with tray on Wayland
2022-09-02 21:27:41 +04:00
Ilya Fedin
38da0e086d
Get rid of lib_waylandshells
2022-09-02 21:27:41 +04:00
Ilya Fedin
f1092753fc
Remove version from the .desktop file
...
Some desktop environments hide the launcher if they don't know the version
2022-09-01 13:53:53 +04:00
Ilya Fedin
5fc7caeec9
Provide old version to Platform::NewVersionLaunched
2022-09-01 13:53:53 +04:00
Ilya Fedin
8c1bef929e
A better way of PiP aspect ratio handling on Wayland
2022-08-08 11:05:52 +04:00
Ilya Fedin
bf339de773
Always pass activation_token option
...
glib shows a warning about invalid GVariant and empty activation_token shouldn't hurt I believe
2022-08-04 17:12:07 +04:00
Ilya Fedin
9e63fc5acd
Let PiP have custom buffer size on Wayland
2022-08-04 16:41:25 +04:00
Ilya Fedin
d500714242
Use xdg-activation to open URLs&files
2022-08-03 15:26:08 +04:00
Ilya Fedin
66c9587650
Add fail callback to linux notifications exceptions handler
2022-07-31 12:21:24 +04:00
Ilya Fedin
8e8a209aad
Guard linux notification inhibition checks
2022-07-28 20:18:51 +04:00
Ilya Fedin
bb8ffcac3a
Default to Wayland on GNOME for new installs
2022-07-28 20:17:49 +04:00
Ilya Fedin
9b8dcec26e
Ensure notification manager is not null before first call to setManager in cross-platform code
2022-07-26 21:11:17 +04:00
Ilya Fedin
6718d238af
Switch to the dummy notification manager when notification daemon is not running on Linux
2022-07-26 21:11:17 +04:00
Ilya Fedin
dd70a6f659
IsQualifiedDaemon -> ByDefault
2022-07-26 21:11:17 +04:00
Ilya Fedin
ff2bd86744
Have a central place for catch-based logging of linux native notifications
2022-07-26 21:11:17 +04:00
Ilya Fedin
d2e3c01c11
Get linux notification inhibition state asynchronously
...
This is the last sync request in the D-Bus notifications
2022-07-26 21:11:17 +04:00
Ilya Fedin
e8477e5911
Get rid of 'paramtersCopy' in dbus code
2022-07-26 21:09:30 +04:00
23rd
57f769f358
Returned lost method that checks tray existence.
2022-06-23 09:38:21 +03:00
Ilya Fedin
798998203a
Get XDG activation token from native notification on Linux
2022-06-15 12:55:59 +04:00
Ilya Fedin
6ee08faa24
Migrate from kwayland to QtWaylandScanner
2022-06-14 16:36:44 +04:00
Ilya Fedin
391a3a77f6
Use Qt's xdg-desktop-portal file dialog implementation
2022-06-14 16:36:44 +04:00
Ilya Fedin
2477b35b42
Move tray availability logging to the appropriate class
2022-06-14 16:36:44 +04:00
Ilya Fedin
4d997a26b0
Don't update global menu on Linux without focus widget
...
The window loses focus when menu is open and edit options are deactivated
2022-06-14 16:36:44 +04:00
Ilya Fedin
4410aeb3eb
Make QMenuBar on Linux work without private API
2022-06-14 16:36:44 +04:00