cwm with "ignore" option changes window geometry from "-0-0" to "-2-2"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

cwm with "ignore" option changes window geometry from "-0-0" to "-2-2"

Andre Stoebe
Hi,

I know this little bug is pretty trivial and more so pedantic, but I
wanted to report it nonetheless and especially ask for confirmation from
other cwm users. It would be great if anyone could try to reproduce.

I'm running a recent snapshot:
OpenBSD 6.4-current (GENERIC.MP) #411: Mon Oct 29 19:18:32 MDT 2018

Consider the following ~/.cwmrc:
# this is important as it doesn't happen without ignoring the window
ignore xclock

As well as this ~/.xsession:
# alternatively, just execute the xclock command directly in cwm
xclock -digital -geometry -0-0 &
cwm

It seems that the xclock window is put at the bottom right edge but with
a 2 pixel gap on both edges. This doesn't happen at the top and left
edges, so it looks like only the bottom and right edges are affected.

"+0+0" (top left) - no gap at top, no gap at left
"-0+0" (top right) - no gap at top, 2 pixel gap at right
"+0-0" (bottom left) - 2 pixel gap at bottom, no gap at left
"-0-0" (bottom right) - 2 pixel gap at bottom, 2 pixel gap at right

Here's the xwininfo output for all combinations.

"+0+0" (top left):

$ xclock -digital -geometry +0+0 &
$ xwininfo
xwininfo: Window id: 0x80000c "xclock"

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 278
  Height: 40
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -1642+0  -1642-1040  +0-1040
  -geometry 278x40+0+0

"-0+0" (top right):

$ xclock -digital -geometry -0+0 &
$ xwininfo
xwininfo: Window id: 0x80000c "xclock"

  Absolute upper-left X:  1640
  Absolute upper-left Y:  0
  Relative upper-left X:  1640
  Relative upper-left Y:  0
  Width: 278
  Height: 40
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +1640+0  -2+0  -2-1040  +1640-1040
  -geometry 278x40-2+0

"+0-0" (bottom left):

$ xclock -digital -geometry +0-0 &
$ xwininfo
xwininfo: Window id: 0x80000c "xclock"

  Absolute upper-left X:  0
  Absolute upper-left Y:  1038
  Relative upper-left X:  0
  Relative upper-left Y:  1038
  Width: 278
  Height: 40
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+1038  -1642+1038  -1642-2  +0-2
  -geometry 278x40+0-2

"-0-0" (bottom right):

$ xclock -digital -geometry -0-0 &
$ xwininfo
xwininfo: Window id: 0x80000c "xclock"

  Absolute upper-left X:  1640
  Absolute upper-left Y:  1038
  Relative upper-left X:  1640
  Relative upper-left Y:  1038
  Width: 278
  Height: 40
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +1640+1038  -2+1038  -2-2  +1640-2
  -geometry 278x40-2-2

Regards
André

Reply | Threaded
Open this post in threaded view
|

Re: cwm with "ignore" option changes window geometry from "-0-0" to "-2-2"

Matthias Schmidt
Hi Andre,

* Andre Stoebe wrote:
> Hi,
>
> I know this little bug is pretty trivial and more so pedantic, but I
> wanted to report it nonetheless and especially ask for confirmation from
> other cwm users. It would be great if anyone could try to reproduce.

Yes, I can reproduce it here (since I have exactly the same setup as you
do).  According to xwininfo the clock is 2 pixels off.  However, xprop
and cwm itself shows an offset of 0 pixels.

Cheers

        Matthias

Reply | Threaded
Open this post in threaded view
|

Re: cwm with "ignore" option changes window geometry from "-0-0" to "-2-2"

Okan Demirmen
In reply to this post by Andre Stoebe
On Thu 2018.11.01 at 13:18 +0100, Andre Stoebe wrote:
> Hi,
>
> I know this little bug is pretty trivial and more so pedantic, but I
> wanted to report it nonetheless and especially ask for confirmation from
> other cwm users. It would be great if anyone could try to reproduce.

Hi Andre,

I can confirm what you are seeing; it's not intentional; it's mostly
because the client (xclock here) sets its border and calculates the x/y
position to hand off to the window manager - it doesn't know that the wm
is going to rip out the border (with 'ignore' keyword) thus with a
default client border of 1, the offset is 2. The client is told its new
border width once the window manager sets it, which is why you see it as
0 after-the-fact; but it's too late. This is only a "problem" when east
and/or south edge placement is requested. I'm sure someone has noticed
this before, right? But if so, I've yet to fix it :) It's good reminder
though! Basically we need to carry the original border width around.
I'll look to a complete fix.

Thanks,
Okan

Reply | Threaded
Open this post in threaded view
|

Re: cwm with "ignore" option changes window geometry from "-0-0" to "-2-2"

Andre Stoebe
Thanks to both of you for the answers.

No worries, I'll resort to positioning xclock at the top left edge for
now, and am looking forward for further improvements to an already
fantastic window manager.

Thanks a lot for all the great work on cwm, Okan!

Regards
Andre

Reply | Threaded
Open this post in threaded view
|

Re: cwm with "ignore" option changes window geometry from "-0-0" to "-2-2"

Okan Demirmen
On Fri 2018.11.02 at 10:07 +0100, Andre Stoebe wrote:

> Thanks to both of you for the answers.
>
> No worries, I'll resort to positioning xclock at the top left edge for
> now, and am looking forward for further improvements to an already
> fantastic window manager.
>
> Thanks a lot for all the great work on cwm, Okan!
>
> Regards
> Andre

Hi all - A fix was applied yesterday to solve this problem. Please let
me know if I missed a corner case :)

Thanks.