Пример #1
0
// Returns True once the window's Geometry changes
// Use with PollFor.
func GeometryDiffers(oldGeom xrect.Rect) GeometryUpdateTester {
	return func(win *xwindow.Window) (bool, error) {
		newGeom, err := win.Geometry()
		if err != nil {
			return false, err
		}
		return (!util.RectEquals(oldGeom, newGeom)), nil
	}
}
Пример #2
0
// Returns True once the window's DecorGeometry changes
// Use with PollFor.
func DecorDiffers(oldDecor xrect.Rect) GeometryUpdateTester {
	return func(win *xwindow.Window) (bool, error) {
		newDecor, err := win.DecorGeometry()
		if err != nil {
			return false, err
		}
		return (!util.RectEquals(oldDecor, newDecor)), nil
	}
}