Skip to content

Conversation

@peteruithoven
Copy link
Collaborator

@peteruithoven peteruithoven commented Jul 6, 2025

Fixes: #626

Currently still freezes the system when --replace --gapplication-replace is used. Not sure why yet.

Any support on this is more than welcome.

@peteruithoven peteruithoven changed the title Draft: Support replace argument adding replace flag WIP: Support replace argument adding replace flag Jul 6, 2025
@peteruithoven peteruithoven marked this pull request as draft July 6, 2025 22:30
@peteruithoven
Copy link
Collaborator Author

After replace, using the monitor in update_panel_dimensions seems to fail, it's null. But the on_realize is called later, which also calls update_panel_dimensions so this is probably not the problem. I've added a check anyway just to be sure.

Below the output of starting wingpanel with replace, it freezing and then me killing it from another session.

io.elementary.wingpanel -r     

(io.elementary.wingpanel:47717): wingpanel-WARNING **: 01:07:41.563: PanelWindow.vala:105: PanelWindow has no window, cannot update dimensions

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.650: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.650: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.650: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.650: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.650: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.650: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): nm-CRITICAL **: 01:07:41.652: ((src/libnm-client-impl/nm-device.c:1143)): assertion '<dropped>' failed

(io.elementary.wingpanel:47717): io.elementary.wingpanel.notifications-WARNING **: 01:07:41.688: Session.vala:84: Key file does not have key “AppIcon” in group “1709080789.547”

(io.elementary.wingpanel:47717): io.elementary.wingpanel.notifications-WARNING **: 01:07:41.688: Session.vala:153: Error opening file “/home/peteruithoven/.cache/.notifications.session”: File exists
[1]    47717 terminated  io.elementary.wingpanel -r

@peteruithoven
Copy link
Collaborator Author

I understand I might not need to add manual argument handling for --replace but people could just use --gapplication-replace. Still freezes the system though.

@vjr
Copy link
Member

vjr commented Jul 7, 2025

I understand I might not need to add manual argument handling for --replace but people could just use --gapplication-replace. Still freezes the system though.

Have you tried moving deregister_indicators before the panel_window.destroy to see if that helps?

@peteruithoven
Copy link
Collaborator Author

@vjr thanks for the tip, but doesn't seem to help.

@vjr
Copy link
Member

vjr commented Jul 7, 2025

@vjr thanks for the tip, but doesn't seem to help.

@peteruithoven I added ApplicationFlags.REPLACE but got a segfault in the deregister loop, so removed the shutdown () override and moved the loop to session_stop ():

wingpanel_replace.diff.gz

Now it appears to work but I don't know what was re-spawning wingpanel before this PR, so don't know if this is really working as it should.

@peteruithoven
Copy link
Collaborator Author

@vjr Looking at your diff.

  • I think the idea is that the replace flag is only added when using --gapplication-replace?
  • In you're diff you've simply removed the destroy override. Which deregister loop did you move? The deregister_indicators call is already in session_stop?

Now it appears to work but I don't know what was re-spawning wingpanel before this PR, so don't know if this is really working as it should.

You can really simply call io.elementary.wingpanel --gapplication-replace and have it replace the current wingpanel, without freezing your session?
Gala normally tries to re-spawn wingpanel as I understand it, see: #619 (comment)

Are you using Wayland? I'm using Wayland.

@vjr
Copy link
Member

vjr commented Jul 7, 2025

@vjr Looking at your diff.

  • I think the idea is that the replace flag is only added when using --gapplication-replace?
  • In you're diff you've simply removed the destroy override. Which deregister loop did you move? The deregister_indicators call is already in session_stop?

Now it appears to work but I don't know what was re-spawning wingpanel before this PR, so don't know if this is really working as it should.

You can really simply call io.elementary.wingpanel --gapplication-replace and have it replace the current wingpanel, without freezing your session? Gala normally tries to re-spawn wingpanel as I understand it, see: #619 (comment)

Are you using Wayland? I'm using Wayland.

Hi @peteruithoven

Yes I am using the replace option --gapplication-replace to test.

Yes I removed the shutdown () override (in my local changes) you added in this PR.

Yes I moved your deregister_indicators from the shutdown () method to the existing session_stop () method.

Yes I simply call io.elementary.wingpanel --gapplication-replace and it appears to work without freezing my session.

Yes I'm using Wayland (secure) session.

Cheers!

@tintou
Copy link
Member

tintou commented Jul 7, 2025

It is not possible to replace the application launched by Gala, Gala need to be the one launching it for now, there is no alternative as we don't have the required API to "adopt" an app launched by some other process

@peteruithoven
Copy link
Collaborator Author

Ah... Thanks for clarifying this @tintou. In that case I'll abort this for now.

@tintou tintou deleted the Replace branch August 20, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement glib.application's replacement functionality

4 participants