Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Panel Plugins
xfce4-docklike-plugin
Commits
a7fd43ce
Commit
a7fd43ce
authored
Nov 26, 2021
by
David Keogh
Browse files
Startup notification support
Closes
#13
Additionally, correctly release memory after launching.
parent
d4e00239
Pipeline
#12272
passed with stages
in 2 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/AppInfos.cpp
View file @
a7fd43ce
...
...
@@ -13,7 +13,14 @@ void AppInfo::launch()
GDesktopAppInfo
*
info
=
g_desktop_app_info_new_from_filename
(
this
->
path
.
c_str
());
if
(
info
!=
NULL
)
g_app_info_launch
((
GAppInfo
*
)
info
,
NULL
,
NULL
,
NULL
);
{
GdkAppLaunchContext
*
context
=
gdk_display_get_app_launch_context
(
Plugin
::
mDisplay
);
g_app_info_launch
(
G_APP_INFO
(
info
),
NULL
,
G_APP_LAUNCH_CONTEXT
(
context
),
NULL
);
g_object_unref
(
context
);
g_object_unref
(
info
);
}
}
void
AppInfo
::
launch_action
(
const
gchar
*
action
)
...
...
@@ -21,7 +28,14 @@ void AppInfo::launch_action(const gchar* action)
GDesktopAppInfo
*
info
=
g_desktop_app_info_new_from_filename
(
this
->
path
.
c_str
());
if
(
info
!=
NULL
)
g_desktop_app_info_launch_action
(
info
,
action
,
NULL
);
{
GdkAppLaunchContext
*
context
=
gdk_display_get_app_launch_context
(
Plugin
::
mDisplay
);
g_desktop_app_info_launch_action
(
info
,
action
,
G_APP_LAUNCH_CONTEXT
(
context
));
g_object_unref
(
context
);
g_object_unref
(
info
);
}
}
void
AppInfo
::
edit
()
...
...
@@ -31,7 +45,7 @@ void AppInfo::edit()
if
(
g_spawn_command_line_sync
(
command
,
NULL
,
NULL
,
NULL
,
NULL
))
{
// If a new desktop file was created, it will be in ~/.local/share/applications
// If the previous file was pinned it needs to be replaced with the new one.
// If the previous file was pinned
,
it needs to be replaced with the new one.
gchar
*
newPath
=
g_build_filename
(
getenv
(
"HOME"
),
"/.local/share/applications/"
,
g_strdup_printf
(
"%s.desktop"
,
this
->
icon
.
c_str
()),
NULL
);
...
...
@@ -50,8 +64,12 @@ void AppInfo::edit()
}
Settings
::
pinnedAppList
.
set
(
pinnedApps
);
g_free
(
newPath
);
}
}
g_free
(
command
);
}
namespace
AppInfos
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment