Skip to content

Commit

Permalink
Disable desktop integration
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Jul 23, 2024
1 parent 635fdd7 commit 08a3756
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
1 change: 0 additions & 1 deletion data/io.github.leolost2605.detective.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<ul>
<li>Fixes icons for some (especially flatpak) apps not showing</li>
<li>Fixes a small visual glitch that caused the background of the search view to have a slightly different color</li>
<li>When selecting an app that already has an window open the window will now be focused, possibly switching to its workspace</li>
<li>App results sorting now takes recently launched apps into account</li>
<li>Improved finding installed apps</li>
<li>Detective will now find apps that were installed while it is running</li>
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option ('desktopintegration', type : 'boolean', value : false)
2 changes: 2 additions & 0 deletions plugins/AppsPlugin/Plugin.vala
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ public class AppMatch : Match {
public override async void activate () throws Error {
RelevancyService.get_default ().app_launched (app_id);

#if DESKTOP_INTEGRATION
var desktop_integration = yield DesktopIntegration.get_instance ();
foreach (var window in yield desktop_integration.get_windows ()) {
if (window.properties["app-id"].get_string () == app_id) {
yield desktop_integration.focus_window (window.uid);
return;
}
}
#endif

Process.spawn_command_line_async ("flatpak-spawn --host " + exec);
}
Expand Down
20 changes: 14 additions & 6 deletions plugins/AppsPlugin/meson.build
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
desktopintegration = get_option('desktopintegration')

sources = [
'Plugin.vala',
'RelevancyService.vala'
]

if desktopintegration
sources += 'DesktopIntegration.vala'
add_project_arguments(['--define', 'DESKTOP_INTEGRATION'], language: 'vala')
endif

shared_library(
'AppsPlugin',
sources: [
'DesktopIntegration.vala',
'Plugin.vala',
'RelevancyService.vala'
],
sources: sources,
dependencies: [
lib_dep,
meson.get_compiler('c').find_library ('m')
],
install: true,
install_dir: plugin_dir
install_dir: plugin_dir,
)

0 comments on commit 08a3756

Please sign in to comment.