You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried the following part of your code in a personal Wingrid tool. When _NET_FRAME_EXTENTS is 0, 0, 0, 0 and _GTK_FRAME_EXTENTS is 2, 2, 22, 10 (or similar values), the tool subtracts 2, 2, 22, 10 from 0, 0, 0, 0. However, since ext is a uint array, this results in underflow, producing values like [18446744073709551600, 18446744073709551600, 18446744073709551606, 18446744073709551584].
I see, do you have any real world application where this happens? What should be the behavior then, negative margins or would it be enough to ensure the values never get negative?
I use Xfce, and there are many unusual return value situations and behaviors. This way does not always work reliably in obtaining the correct frame borders. I made some manual overrides based on the window class, such as for Telegram Desktop (correcting frameborders + window position).
Speaking about this part, I fixed it as follows:
func (a *ActiveWindow) GetExtents() {
a.NetFrameExt, _ = xprop.PropValNums(xprop.GetProperty(Xutil, a.WindowID, "_NET_FRAME_EXTENTS"))
a.GtkFrameExt, _ = xprop.PropValNums(xprop.GetProperty(Xutil, a.WindowID, "_GTK_FRAME_EXTENTS"))
a.FrameBorders = make([]int, 4)
for i, e := range a.NetFrameExt {
a.FrameBorders[i] += int(e)
}
for i, e := range a.GtkFrameExt {
if !a.IsGtkFrame && e > 0 {
a.IsGtkFrame = true
}
a.FrameBorders[i] -= int(e)
}
}
I tried the following part of your code in a personal Wingrid tool. When
_NET_FRAME_EXTENTS
is0, 0, 0, 0
and_GTK_FRAME_EXTENTS
is2, 2, 22, 10
(or similar values), the tool subtracts2, 2, 22, 10
from0, 0, 0, 0
. However, sinceext
is auint
array, this results in underflow, producing values like[18446744073709551600, 18446744073709551600, 18446744073709551606, 18446744073709551584]
.The text was updated successfully, but these errors were encountered: