Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
xfce4-power-manager
Manage
Activity
Members
Labels
Plan
Issues
65
Issue boards
Milestones
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xfce
xfce4-power-manager
Commits
0329b291
Commit
0329b291
authored
2 months ago
by
Manu Barrio Linares
Committed by
Gaël Bonithon
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove all lingering Inhibitors when DBus connection is lost
Fixes:
#248
parent
9db37016
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!81
Remove all lingering Inhibitors when DBus connection is lost
Pipeline
#32606
passed with stages
in 6 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xfpm-inhibit.c
+15
-26
15 additions, 26 deletions
src/xfpm-inhibit.c
with
15 additions
and
26 deletions
src/xfpm-inhibit.c
+
15
−
26
View file @
0329b291
...
...
@@ -153,24 +153,6 @@ xfpm_inhibit_find_application_by_cookie (XfpmInhibit *inhibit,
return
NULL
;
}
static
Inhibitor
*
xfpm_inhibit_find_application_by_unique_connection_name
(
XfpmInhibit
*
inhibit
,
const
gchar
*
unique_name
)
{
guint
i
;
Inhibitor
*
inhibitor
;
for
(
i
=
0
;
i
<
inhibit
->
priv
->
array
->
len
;
i
++
)
{
inhibitor
=
g_ptr_array_index
(
inhibit
->
priv
->
array
,
i
);
if
(
g_strcmp0
(
inhibitor
->
unique_name
,
unique_name
)
==
0
)
{
return
inhibitor
;
}
}
return
NULL
;
}
static
gboolean
xfpm_inhibit_remove_application_by_cookie
(
XfpmInhibit
*
inhibit
,
guint
cookie
)
...
...
@@ -195,19 +177,26 @@ xfpm_inhibit_connection_lost_cb (XfpmDBusMonitor *monitor,
XfpmInhibit
*
inhibit
)
{
Inhibitor
*
inhibitor
;
gboolean
changed
=
FALSE
;
if
(
!
on_session
)
return
;
inhibitor
=
xfpm_inhibit_find_application_by_unique_connection_name
(
inhibit
,
unique_name
);
if
(
inhibitor
)
// Traverse in reverse to safely delete array elements without shifting issues
for
(
guint
i
=
inhibit
->
priv
->
array
->
len
-
1
;
i
!=
-
1U
;
i
--
)
{
XFPM_DEBUG
(
"Application=%s with unique connection name=%s disconnected"
,
inhibitor
->
app_name
,
inhibitor
->
unique_name
);
xfpm_inhibit_free_inhibitor
(
inhibit
,
inhibitor
);
xfpm_inhibit_has_inhibit_changed
(
inhibit
);
inhibitor
=
g_ptr_array_index
(
inhibit
->
priv
->
array
,
i
);
if
(
g_strcmp0
(
inhibitor
->
unique_name
,
unique_name
)
==
0
)
{
XFPM_DEBUG
(
"Application=%s with unique connection name=%s disconnected"
,
inhibitor
->
app_name
,
inhibitor
->
unique_name
);
xfpm_inhibit_free_inhibitor
(
inhibit
,
inhibitor
);
changed
=
TRUE
;
}
}
if
(
changed
)
xfpm_inhibit_has_inhibit_changed
(
inhibit
);
}
static
void
...
...
@@ -413,7 +402,7 @@ xfpm_inhibit_un_inhibit (XfpmInhibit *inhibit,
guint
IN_cookie
,
gpointer
user_data
)
{
XFPM_DEBUG
(
"Un
H
ibit message received"
);
XFPM_DEBUG
(
"Un
inh
ibit message received"
);
if
(
!
xfpm_inhibit_remove_application_by_cookie
(
inhibit
,
IN_cookie
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment