Skip to content

Fixing bug where position was wrong after monitors change.

Joel Denning requested to merge joeldenning/mmod-panel:monitors-changed into master

I am admittedly not very knowledgeable about gnome, gnome-shell, or even linux and welcome any feedback on this merge request!

I recently started using this extension and experience a bug whenever I plug or unplug a monitor into my laptop. I have set up mmod-panel to be at the bottom of the screen instead of at the top, but whenever I plug/unplug external monitors the panel jumps to the top of the screen. The manual workaround for me has been to turn the extension off and on again inside of gnome tweak tool.

After digging into some of the gnome-shell source code, I found that the layoutManager fires an event called monitors-changed whenever a monitor is connected or disconnected. My code here connects to that event and calls the onPreferenceChanged function whenever that happens, which fixes the bug for me. I was able to test that this works for me by manually modifying the locally installed extension, restarting gnome-shell, and trying it out.

I wasn't sure whether it was best to put this in extension.js or inside of position.js and welcome any feedback about what would be best.

Edited by Joel Denning

Merge request reports