Panning support - tiny hack

Bug #602298 reported by Gabriel Garcia
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
disper
Wishlist
Unassigned

Bug Description

I use disper -e mostly to extend/shrink my laptop's screen in twinview whenever I connect/disconnect to/from an external display. it always annoyed me that there's a dead area, as the screen resolutions are never the same. I could only fix this with nvidia-settings, but wanted disper to do it automatically, that is, automatic panning. I created a tiny (and a bit dirty) hack for this, which I'm attaching.

Also, I refused to use 2 X screens... mostly for being lazy, I might give it a try in the future.

Notes about this hack:
- It might be wise to add another option to disper to disable auto panning, in case someone doesn't want it.
- I tested it for right and top orientations (should work for left and bottom) on a Dell Latitude E6500.
- The code itself is a bit dirty as it cycles through the resolutions first to figure out maximum width or height and then cycles again to create the metadata - it would be nice if the nvidia method could do this, but I'm not sure how free I am to modify that bit of code.
- Like the author said in one of the comments, this needs some refactoring ;-)
- Suggestions, other ideas, constructive criticism is welcome. I'm not a very experienced Python developer.

Revision history for this message
Gabriel Garcia (gabriel-gagv) wrote :
Revision history for this message
wvengen (wvengen) wrote :

Hi! Someone's actually using panning :)
If more people are using panning, I'd be happy to add it. The important question is: what do people use it for, why and how? You are more than welcome to carefully answer these three questions.

My answer would be something like: the 'dead area' is annoying, sometimes stuff can 'disappear' into that area. This is best solved by making sure that is treated as really off-screen (window manager+toolkits looking at Xinerama info). If that is a little hard to achieve, one could make X pan to the area when the mouse cursor moves there and pan back to the default immediately when the cursor leaves the area (the latter is not possible by default iirc).

Disper is a user-centric interface around low-level display interfaces, that's why I'm asking this.

Changed in disper:
assignee: nobody → wvengen (wvengen)
importance: Undecided → Wishlist
Revision history for this message
wvengen (wvengen) wrote :

Oh, and thanks for the patch! I'll see if I can add something like this in a clean enough way. I'm a little busy though right now.

Revision history for this message
Gabriel Garcia (gabriel-gagv) wrote :

Thanks, wvengen.
My main answer to the "what for" and "why" questions is the dead areas as well. I played a little bit with xfce4 yesterday and couldn't make it show the status bar (or panel I think it is) properly without recurring to nvidia-settings to either fix the offset or enable panning.
I'm currently using sawfish as WM (yes, I know... but it's very very lightweight and fast) and sometimes the middle button menus appear in that dead area, or windows are partially placed in there - I find panning to be a nice workaround, and don't mind the screen moving (in fact, I think it's quite cool).

I have seen another use case where users just want an extra inch all around; surprisingly, it's quite useful (my hack doesn't support this, though).

How would you use it? I suppose you could take a virtual screen parameter for the whole screen and then build the metamodes based on that. The parameter can be optional, in which case you wouldn't have panning at all. It could accept "auto", in which case you would do what my hack does. And finally it can accept the actual full virtual size of the n screens, in which case you use that to calculate panning on an individual basis.

Regarding how unclean my hack is, if I can think of a way to refactor the way disper -e is executed, I'll definitely post it here as a patch. In the meantime, I'll keep this in my local copy of the repository. I am not experienced enough with X, WMs and nvidia, so it takes a while and I drive as carefully as I can.

Thanks a lot anyway, this is a very useful tool!

Revision history for this message
wvengen (wvengen) wrote :

Thanks for your reply. It may be useful to have a command-line option or so to enable auto-panning. Ideally I'd implement that as a plugin, for which support is present in trunk and will be part of disper 0.2.4. This will require a Python-based plugin as it modifies the resolution list, and that is not really finished yet.

Changed in disper:
assignee: wvengen (wvengen) → nobody
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers