xyb3rt / sxiv

Simple X Image Viewer
GNU General Public License v2.0
1.82k stars 260 forks source link

Window straddles monitors on multimonitor #9

Closed mathstuf closed 12 years ago

mathstuf commented 13 years ago

I use XMonad and when I have the next window "float" out of tiling, sxiv will pop up in the center of my two (identical) screens if focus is on the left and if focus is on the right, it shows up with the right half off the screen. Not sure what sxiv needs from X to know where to pop up. Most apps tend to just get it right. Maybe sxiv is trying some geometry stuff that gets mixed up with tiling?

xyb3rt commented 13 years ago

I don't have a two-monitor setup so I couldn't reproduce your issue. Does sxiv also behave in this strange way, when you're only using one monitor?

mathstuf commented 13 years ago

I was unable to get it to do anything weird with just one monitor.

wagdav commented 12 years ago

I've just install sxiv on my computer. I'm using XMonad with two screens and I do not experience any problems with sxiv. I tried tiled and floated it seems to work fine. Although I don't know what the next window is...

mathstuf commented 12 years ago

On Mon, Mar 19, 2012 at 02:03:21 -0700, David Wagner wrote:

I've just install sxiv on my computer. I'm using XMonad with two screens and I do not experience any problems with sxiv.

Hmm...I'll try bisecting my configuration then.

I tried tiled and floated it seems to work fine. Although I don't know what the next window is...

I have bindings which modify where/how the next window will show up (tiled/floating, unfocused/focused, below/above).

xyb3rt commented 12 years ago

Any news on this issue?

xyb3rt commented 12 years ago

I am closing this issue because it seems to be caused by user configuration.

mathstuf commented 11 years ago

I am able to reproduce with a stock default XMonad configuration that floats all new windows. This is with sxiv 1.1 and XMonad 0.11.

mathstuf commented 10 years ago

Ping?

xyb3rt commented 10 years ago

Does the issue#9 branch fix this issue for you? I hope that no one will whine about the new startup behaviour in case it does and is merged into master.

mathstuf commented 10 years ago

It does, but I wonder if it'd be better to fix the win_init function to get the current Xrandr screen rather than the Xlib screen definition (which does indeed straddle the monitors). Would you be adverse to using Xrandr for information (if the extension is available)? The win_env_t would probably need to be updated on Xrandr change events and when it moves to a different screen.

xyb3rt commented 10 years ago

I do not want to fix this using Xrandr, because I think it's too much work for such a trivial thing. I rather rely on the window manager to center windows and I hope that the users of sxiv do so too.

mathstuf commented 10 years ago

What's a WM going to do? If I'm floating windows, the window places itself. And the sxiv window isn't requesting that the WM center it; it's placing itself in a non-optimal position. To fix this, I'd have to first detect that I'm floating, check for sxiv then handle it specially. Doing this for umpteen apps is untenable; sxiv should just place itself properly.

Anyways, Xrandr doesn't seem to be necessary. Here is mpv's code to handle this (which works 100% for me).

xyb3rt commented 10 years ago

sxiv is placing itself in a non-optimal position? I've used lots of X applications over the years and a lot of them placed their window in the top left corner of the screen. If a user doesn't like this she typically wants all of her floating windows centered and that's where her window manager comes into play. Using ~30 LOC depending on Xrandr/Xinerama just to center the window at startup is no option for me. And last time I've checked, I was the author of sxiv. And the last time I've checked the third sentence of the README said something like this: "The primary goal for writing sxiv is to create an image viewer, which only has the most basic features required for fast image viewing (the ones I want)." I have almost no time at all to maintain sxiv. Fixing issues, adding features requested by users and merging pull requests with the possible burden to fix issues in the touched code later on does not pay my rent nor the food for my child.

mathstuf commented 10 years ago

Top-left is fine with me as well, but it being centered on my monitor bezels is what is not optimal. I was suggesting ways it could be done to still center, but also support multiple monitors.

Either way, it seems that sxiv is feature complete for you, so it would be nice to mention in the readme that new things would have a very high barrier to acceptance would be nice (e.g., would something like webp, apng, or other format support be accepted if patches were made). Or consider a co-maintainer (I'm not applying; I also don't have much time to devote and sxiv is firmly in the "does the job well enough" category for me).