dk / Prima

prima.eu.org
Other
108 stars 27 forks source link

podview window opens too wide on dual monitors #40

Closed devel-chm closed 7 years ago

devel-chm commented 8 years ago

I have a dual monitor setup and the initial window size selected running "podview Prima" or whatever always spans 1 1/2 monitors in width. This blocks my other windows and is wasteful since about 1/2 the width of either monitor by itself is more than sufficient to display the POD documentation.

Is there a way to control the window size (I didn't find one searching the manual)? Is there a reason that the default cannot be "smarter" by setting an upper bound on the width of the text displayed?

dk commented 8 years ago

There's a way to query the monitor setup with $::application->get_monitor_rects and adjusting the window to one's needs. However this is not the defaults, and works only if you have compiled Prima with xrandr extension. As for why this is not the default, simply because it was overlooked. I'll take a look at it when I'll have a dual monitor setup for testing.

devel-chm commented 8 years ago

It might be simpler to just cap the size of the window based on the number of characters text across and down. That wouldn't need fancy xrandr support and would get effectively the same result---too wide windows are not created. Thanks for taking a look.

--Chris

On Wed, Mar 9, 2016 at 2:21 PM, Dmitry Karasik notifications@github.com wrote:

There's a way to query the monitor setup with $::application->get_monitor_rects and adjusting the window to one's needs. However this is not the defaults, and works only if you have compiled Prima with xrandr extension. As for why this is not the default, simply because it was overlooked. I'll take a look at it when I'll have a dual monitor setup for testing.

— Reply to this email directly or view it on GitHub https://github.com/dk/Prima/issues/40#issuecomment-194462733.

dk commented 8 years ago

Yes, that would work for podview. I was looking at a more generic change in behavior, to not create too wide windows as a common default. The commit I've applied should (theoretically) do that, but I didn't test it on dual setup yet. If you could find time to try it as see if it works as intended, please do.

dk commented 8 years ago

Tested on the dual setup, looks okay. I'm closing the ticket.

devel-chm commented 7 years ago

I still have this problem with Prima 1.49 on a dual monitor setup with cygwin64/win7 with XWin running in -multiwindow mode. This is the mode where the root X window is hidden and each of the client windows appear in their own win7 window. If there were an option to set the desired size or an environment variable that would work.

devel-chm commented 7 years ago

For example, with 2 1920 wide monitors, the xwininfo for the podview window is:

`xwininfo: Window id: 0x1e0000d "POD viewer - Moo"

Absolute upper-left X: 8 Absolute upper-left Y: 172 Relative upper-left X: 8 Relative upper-left Y: 172 Width: 2880 Height: 923 Depth: 24 Visual: 0x21 Visual Class: TrueColor Border width: 0 Class: InputOutput Colormap: 0x20 (installed) Bit Gravity State: ForgetGravity Window Gravity State: NorthWestGravity Backing Store State: NotUseful Save Under State: no Map State: IsViewable Override Redirect State: no Corners: +8+172 -952+172 -952-105 +8-105 -geometry 2880x923+8+172 `

dk commented 7 years ago

Hi, so, if I add support for parsing geometry, Xt-style ( WxH+X+Y ), would that work for you?

devel-chm commented 7 years ago

Yes. -chm

On Wed, Oct 26, 2016 at 1:23 PM, Dmitry Karasik notifications@github.com wrote:

Hi, so, if I add support for parsing geometry, Xt-style ( WxH+X+Y ), would that work for you?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/dk/Prima/issues/40#issuecomment-256418582, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwNeSFHdNYpp3Z9_YbFRhpjZqcQXfSyks5q34yQgaJpZM4HtDCB .

dk commented 7 years ago

Please take a look at it if it works for you.

/dk

devel-chm commented 7 years ago

It works. Would it be possible to not require the position options and let the system put the window where the window manager wants to? The docs for the option should specify that the units are pixels.

Thanks for the fix!

devel-chm commented 7 years ago

Perfect and wonderful! Thanks, Dmitry!

dk commented 7 years ago

You're welcome :)

devel-chm commented 7 years ago

I don't know if this is related but podview with Prima 1.49 now segfaults on exit. When I run from the build directory I get this

perl -Mblib utils/podview -geometry=1000x800 Moo X Error: BadWindow (invalid Window parameter), request: 4(X_DestroyWindow), between unix/apc_widget.c:564 and unix/apc_widget.c:571

This may be more a 1.45 vs 1.49 issue since I just upgraded to try out the app-shadertoy work by Max.

dk commented 7 years ago

Whoops, that was a bug :) Thank you for reporting!

/dk