BunsenLabs / bunsen-utilities

https://pkg.bunsenlabs.org/debian/pool/main/b/bunsen-utilities/
GNU General Public License v3.0
30 stars 21 forks source link

bl-exit/merlin: Need test for current monitor #50

Closed capn-damo closed 8 years ago

capn-damo commented 8 years ago

ATM we have (_, _, width, _) = gtk.gdk.Screen(BlexitWindowMerlin).get_monitor_geometry(0)

This works if the Openbox placement policy is "Smart", but not if it is "UnderMouse"

To ensure the exit dialog appears on a specified monitor, and not under the mouse on another one, and with the correct width, rc.xml needs to have

    <application class="Bl-exit" name="bl-exit">
      <position force="yes">
        <x>center</x>
        <y>center</y>
        <monitor>1</monitor>
      </position>
      <focus>yes</focus>
      <decor>no</decor>
      <shade>no</shade>
      <desktop>all</desktop>
      <maximized>horizontal</maximized>
      <fullscreen>no</fullscreen>
    </application>

This seems a bit clumsy, and requires the user to edit 2 scripts. Slightly better I think is to have a global var at the top of bl-exit:

monitor = 0
etc
(_, _, width, _) = gtk.gdk.Screen(BlexitWindowMerlin).get_monitor_geometry(monitor)

A better solution might be to detect where the mouse is, set monitor that way, and do away with the openbox config. And would this need to determine if "Smart" or "UnderMouse" is being used?

xaosfiftytwo commented 8 years ago

Why a global var if it is only used in one statement?

xaosfiftytwo commented 8 years ago

I am digging deeper into this. Tests show that a trio of applications is involved: bl-exit, openbox and xrandr (setting or not setting the primary monitor)

It will not be evident to find a solution that works in all cases, without dragging in other python libraries.

capn-damo commented 8 years ago

By global I mean in a prominent place at the beginning of the script, so it would be easy for someone to edit. Slightly O/T now, after your other work.