Tiling windows by dragging to the corners can break maximization

Issue Description

When "Automatically tile windows when moving towards edge of screen" is turned on in Window Manager Tweaks, using the mouse to rapidly maximize and then tile a window results in window controls not functioning -- the window behaves like it both is and is not maximized at the same time.

Steps to Reproduce

  1. Start xfwl4 and ensure Settings -> Window Manager Tweaks -> Accessibility -> Automatically tile windows when moving towards edge of screen is turned on.
  2. Open a Thunar window
  3. Drag the titlebar rapidly to the top-left corner of the screen, hitting the top of the screen before the left.
  4. The window will momentarily flash maximized due to being dragged to the top of the screen and then tile to the top-left quarter of the screen due to being dragged to the corner. If the action is fast enough, the window will be left in an inconsistent state where
    • The maximize button neither maximizes nor restores the window
    • The window can be freely dragged around the screen but has no resize handles on its sides.
    • Minimizing the window and restoring it does not correct this state, however using the window menu to maximize and restore it does.

Expected Behavior

The maximize button should adjust windows that are tiled to fill 1/4 of the screen so that they fill the whole screen.

Additional Information

I reproduced this with default theming to verify it is not theme specific.

Environment & Versions

  • OS distribution and version: Devuan 6 Excalibur
  • Overall Xfce version: Latest development releases or main branches mostly.
  • xfwl4 version (git hash if not a release): fc68362f
  • libxfce4ui version (git hash if not a release): 4.21.8
  • xfce4-settings version (git hash if not a release): e7c5907eb420e5663b2bfdea01612ed0dfd9bbfd
  • GTK theme: Adwaita
  • Decorations theme: Default
  • GPU make and model: NVidia GTK-960 (with Nouveau driver)
  • Monitor scale factor(s): 1