Conditions Editor not responding as expected.

Seeing something odd in the conditions editor. If I have the following... it works.

focused_window_x >= focused_screen_x

Similarly, if I have the following, this too works...

focused_window_x <= focused_screen_x + 40

However, trying to combine them does not work...

focused_window_x >= focused_screen_x and focused_window_x <= focused_screen_x + 40

Two issues here.

  1. When typing the condition after the and, the editor suddenly and unexpectedly deletes what you're typing and replaces it with TRUEPREDICATE, causing you to lose your work.
  2. Even trying to paste that in after editing it elsewhere, the same thing happens. However, you can paste it a second time and while this time it will stay, the condition results always show true, meaning it's not actually being evaluated

FWIW, I also tried with parentheses. Same thing.

(focused_window_x >= focused_screen_x) and (focused_window_x <= focused_screen_x + 40)

For the record, the reason I'm trying to do this is I'm trying to detect if my current window is maximized (not full-screen, but maximized) by checking if all four of its edges are within 40 pixels of the current screen's edges. But even this is frustrating because to check the right side (bottom too), youd have to do this...

focused_window_x + focused_window_width >= focused_screen_x + focused_window_x - 40
focused_window_x + focused_window_width <= focused_screen_x + focused_window_x - 40

This could be greatly simplified if you added left, top, right and bottom versions (maybe as offsets, not actual values) instead of just x and y.

Further, even in your current version, focused_window_x is relative to the entire desktop, not the current monitor, so you can't even hard-code numeric values as they would be invalidated if you rearranged your screen. There too something like focused_window_local_x to represent the x value local to the screen, not the desktop would be great and would simplify this (which again, doesn't work anyway)...

// Left edge
focused_window_x >= focused_screen_x
AND focused_window_x <= focused_screen_x + 50

// Top edge
AND focused_window_y >= focused_screen_y
AND focused_window_y <= focused_screen_y + 50

// Right edge
AND focused_window_x + focused_window_width >= focused_screen_x + focused_screen_width - 50
AND focused_window_x + focused_window_width <= focused_screen_x + focused_screen_width

// Bottom edge
AND focused_window_y + focused_window_height >= focused_screen_y + focused_screen_height - 50
AND focused_window_y + focused_window_height <= focused_screen_y + focused_screen_height

With my suggestions it could be simply this...

focused_window_local_left_offset >= 0
AND focused_window_local_left_offset <= 40

AND focused_window_local_top_offset >= 0
AND focused_window_local_top_offset <= 40

AND focused_window_local_right_offset >= 0
AND focused_window_local_right_offset <= 40

AND focused_window_local_bottom_offset >= 0
AND focused_window_local_bottom_offset <= 40

...which coincidentally, would also work with your visual editor! :slight_smile: