rxhanson / Rectangle

Move and resize windows on macOS with keyboard shortcuts and snap areas
https://rectangleapp.com
Other
25.13k stars 744 forks source link

Photoshop workspace resizes when changing layers #1221

Open furf opened 11 months ago

furf commented 11 months ago

Rectangle conflicts w/ latest 24.7.0 release of Photoshop. I noticed it while it was in beta as well.

When switching layers in PS, the workspace window resizes. Disabling Rectangle resolves the issue.

See video: https://github.com/rxhanson/Rectangle/assets/35775/30a69603-9b92-4753-aa4e-9f6800a139cf

OG Tweets

Photoshop version: 24.7.0 macOS version: 12.5 Rectangle version: v0.69 Logs if applicable (In Rectangle menu, hold option, "View Logging..."):

{
  "bundleId" : "com.knollsoft.Rectangle",
  "defaults" : {
    "allowAnyShortcut" : {
      "bool" : false
    },
    "almostMaximizeHeight" : {
      "float" : 0
    },
    "almostMaximizeWidth" : {
      "float" : 0
    },
    "alternateDefaultShortcuts" : {
      "bool" : true
    },
    "altThirdCycle" : {
      "int" : 0
    },
    "alwaysAccountForStage" : {
      "int" : 0
    },
    "applyGapsToMaximize" : {
      "int" : 0
    },
    "applyGapsToMaximizeHeight" : {
      "int" : 0
    },
    "attemptMatchOnNextPrevDisplay" : {
      "int" : 0
    },
    "autoMaximize" : {
      "int" : 0
    },
    "cascadeAllDeltaSize" : {
      "float" : 30
    },
    "centeredDirectionalMove" : {
      "int" : 0
    },
    "centerHalfCycles" : {
      "int" : 0
    },
    "cornerSnapAreaSize" : {
      "float" : 20
    },
    "curtainChangeSize" : {
      "int" : 0
    },
    "disabledApps" : {

    },
    "dragFromStage" : {
      "int" : 0
    },
    "enhancedUI" : {
      "int" : 1
    },
    "footprintAlpha" : {
      "float" : 0.30000001192092896
    },
    "footprintAnimationDurationMultiplier" : {
      "float" : 0
    },
    "footprintBorderWidth" : {
      "float" : 2
    },
    "footprintColor" : {

    },
    "footprintFade" : {
      "int" : 0
    },
    "fullIgnoreBundleIds" : {

    },
    "gapSize" : {
      "float" : 0
    },
    "hideMenubarIcon" : {
      "bool" : true
    },
    "ignoredSnapAreas" : {
      "int" : 0
    },
    "landscapeSnapAreas" : {

    },
    "launchOnLogin" : {
      "bool" : true
    },
    "minimumWindowHeight" : {
      "float" : 0
    },
    "minimumWindowWidth" : {
      "float" : 0
    },
    "missionControlDragging" : {
      "int" : 0
    },
    "missionControlDraggingAllowedOffscreenDistance" : {
      "float" : 25
    },
    "missionControlDraggingDisallowedDuration" : {
      "int" : 250
    },
    "moveCursor" : {
      "int" : 0
    },
    "moveCursorAcrossDisplays" : {
      "int" : 0
    },
    "notifiedOfProblemApps" : {
      "bool" : false
    },
    "obtainWindowOnClick" : {
      "int" : 0
    },
    "portraitSnapAreas" : {

    },
    "relaunchOpensMenu" : {
      "bool" : false
    },
    "resizeOnDirectionalMove" : {
      "bool" : false
    },
    "screenEdgeGapBottom" : {
      "float" : 0
    },
    "screenEdgeGapLeft" : {
      "float" : 0
    },
    "screenEdgeGapRight" : {
      "float" : 0
    },
    "screenEdgeGapsOnMainScreenOnly" : {
      "bool" : false
    },
    "screenEdgeGapTop" : {
      "float" : 0
    },
    "shortEdgeSnapAreaSize" : {
      "float" : 145
    },
    "showAllActionsInMenu" : {
      "int" : 0
    },
    "sixthsSnapArea" : {
      "int" : 0
    },
    "sizeOffset" : {
      "float" : 0
    },
    "snapEdgeMarginBottom" : {
      "float" : 5
    },
    "snapEdgeMarginLeft" : {
      "float" : 5
    },
    "snapEdgeMarginRight" : {
      "float" : 5
    },
    "snapEdgeMarginTop" : {
      "float" : 5
    },
    "snapModifiers" : {
      "int" : 0
    },
    "specifiedHeight" : {
      "float" : 1050
    },
    "specifiedWidth" : {
      "float" : 1680
    },
    "stageSize" : {
      "float" : 190
    },
    "subsequentExecutionMode" : {
      "int" : 1
    },
    "SUEnableAutomaticChecks" : {
      "bool" : true
    },
    "todo" : {
      "int" : 2
    },
    "todoApplication" : {

    },
    "todoMode" : {
      "bool" : false
    },
    "todoSidebarSide" : {
      "int" : 1
    },
    "todoSidebarWidth" : {
      "float" : 400
    },
    "traverseSingleScreen" : {
      "int" : 0
    },
    "unsnapRestore" : {
      "int" : 0
    },
    "windowSnapping" : {
      "int" : 0
    }
  },
  "shortcuts" : {
    "bottomHalf" : {
      "keyCode" : 125,
      "modifierFlags" : 1572864
    },
    "bottomLeft" : {
      "keyCode" : 38,
      "modifierFlags" : 786432
    },
    "bottomRight" : {
      "keyCode" : 40,
      "modifierFlags" : 786432
    },
    "center" : {
      "keyCode" : 8,
      "modifierFlags" : 786432
    },
    "centerHalf" : {
      "keyCode" : 49,
      "modifierFlags" : 1703936
    },
    "centerThird" : {
      "keyCode" : 19,
      "modifierFlags" : 1572864
    },
    "firstThird" : {
      "keyCode" : 18,
      "modifierFlags" : 1572864
    },
    "firstTwoThirds" : {
      "keyCode" : 123,
      "modifierFlags" : 1703936
    },
    "larger" : {
      "keyCode" : 24,
      "modifierFlags" : 786432
    },
    "lastThird" : {
      "keyCode" : 20,
      "modifierFlags" : 1572864
    },
    "lastTwoThirds" : {
      "keyCode" : 124,
      "modifierFlags" : 1703936
    },
    "leftHalf" : {
      "keyCode" : 123,
      "modifierFlags" : 1572864
    },
    "maximize" : {
      "keyCode" : 49,
      "modifierFlags" : 1572864
    },
    "maximizeHeight" : {
      "keyCode" : 126,
      "modifierFlags" : 917504
    },
    "nextDisplay" : {
      "keyCode" : 124,
      "modifierFlags" : 1835008
    },
    "previousDisplay" : {
      "keyCode" : 123,
      "modifierFlags" : 1835008
    },
    "reflowTodo" : {
      "keyCode" : 45,
      "modifierFlags" : 786432
    },
    "restore" : {
      "keyCode" : 51,
      "modifierFlags" : 786432
    },
    "rightHalf" : {
      "keyCode" : 124,
      "modifierFlags" : 1572864
    },
    "smaller" : {
      "keyCode" : 27,
      "modifierFlags" : 786432
    },
    "toggleTodo" : {
      "keyCode" : 11,
      "modifierFlags" : 786432
    },
    "topHalf" : {
      "keyCode" : 126,
      "modifierFlags" : 1572864
    },
    "topLeft" : {
      "keyCode" : 32,
      "modifierFlags" : 786432
    },
    "topRight" : {
      "keyCode" : 34,
      "modifierFlags" : 786432
    }
  },
  "version" : "75"
}
rxhanson commented 11 months ago

Thanks for reporting. Would you mind including any logs that get generated when this happens?

In Rectangle menu, hold option, "View Logging..."

furf commented 11 months ago

I don't see "View Logging…" in menu or prefs:

image image
furf commented 11 months ago
image
rxhanson commented 11 months ago

Hold the option key in the menu (it replaces "About").

furf commented 11 months ago

Ah… I misread your previous message.

The logging only updates when I use Rectangle commands. When I switch layers in PS, the window resizes, but no logs are generated.

2023-08-01T12:56:31-07:00: AX sizing proposed: (1280.0, 1415.0), result: (1280.0, 1380.0)
2023-08-01T12:56:31-07:00: AX position proposed: (-2560.0, 25.0), result: (-2560.0, 25.0)
2023-08-01T12:56:31-07:00: AX sizing proposed: (1280.0, 1415.0), result: (1280.0, 1415.0)
2023-08-01T12:56:31-07:00: leftHalf | display: (-2560.0, 0.0, 2560.0, 1415.0), calculatedRect: (-2560.0, 25.0, 1280.0, 1415.0), resultRect: (-2560.0, 25.0, 1280.0, 1415.0), srcScreen: LG UltraFine (2), destScreen: LG UltraFine (2), resultScreen: LG UltraFine (2)
2023-08-01T12:56:35-07:00: AX sizing proposed: (1280.0, 1415.0), result: (1280.0, 1380.0)
2023-08-01T12:56:36-07:00: AX position proposed: (-2560.0, 25.0), result: (-2560.0, 25.0)
2023-08-01T12:56:36-07:00: AX sizing proposed: (1280.0, 1415.0), result: (1280.0, 1415.0)
2023-08-01T12:56:36-07:00: leftHalf | display: (-2560.0, 0.0, 2560.0, 1415.0), calculatedRect: (-2560.0, 25.0, 1280.0, 1415.0), resultRect: (-2560.0, 25.0, 1280.0, 1415.0), srcScreen: LG UltraFine (2), destScreen: LG UltraFine (2), resultScreen: LG UltraFine (2)

https://github.com/rxhanson/Rectangle/assets/35775/c741c3b8-e0d1-4642-ace6-95d9ba0e4d68

rxhanson commented 11 months ago

Thanks! Here's what's going on:

  1. No logging for the resizing means that Rectangle is not resizing the window. This is helpful because we can say that it's not due to some sort of "unsnap restore" where the window could be being moved by your click.
  2. This likely means that photoshop is having issues with the fact that Rectangle is listening to clicks (which needs to be done in order for the drag to screen edge snap). If you uncheck the box for "Snap windows by dragging" in the Snap areas tab of the prefs, I suspect you won't see this issue.
  3. If that's the case, the best solution here would be if Photoshop would fix the issue their side. Rectangle could be configured in such a way that when you ignore Photoshop via the menu bar menu then it will also disable the snap windows by dragging for Photoshop. This could be done currently via terminal command, or I could modify the code for it.
furf commented 11 months ago

Unchecking the preference did not help. Nor did unchecking "Restore window size when unsnapped." (Tried just in case.)

While testing, I noticed the following behavior. If I do nothing (i.e. on startup) or manually resize the workspace window before switching layers, there is no resize. If I use Rectangle to resize the window, it will resize upon switching layers.

https://github.com/rxhanson/Rectangle/assets/35775/68b337db-5136-44c7-8011-2656ca16c6d9

I only realized now, after reading your #3, that I could block specific apps. That feature is only available via the menu. It would be nice if that feature was more visible in the general prefs. I would have disabled Rectangle w/ Photoshop long ago for different reasons (keystroke collisions). It will take some getting used to, but I'm going to move forward with that solution for myself. I'll be happy to re-enable and continue testing for you if you have other ideas.

rxhanson commented 11 months ago

Thanks for the additional info here. Unfortunately, what this means is that Photoshop is doing some sort of fragile window behavior that doesn't take into account whether or not a window is placed using the Accessibility API (the only way to move/resize windows as a 3rd party). There's not really anything that makes sense to do from the Rectangle side, so the only logical path forward from my perspective is to create an issue with Photoshop.

It would be nice if that feature was more visible in the general prefs.

It's a convention to do it this way, and adding it in the prefs UI is a lot of effort for a solution that is in my opinion not as elegant as just doing it in the menu. If there's enough demand with any feature, I can see allowing it in, though.

andrwmai commented 9 months ago

https://github.com/rxhanson/Rectangle/assets/48293860/5b0e7da1-16ac-4a3d-a6b8-c2d68272f6a6

Hey guys, I'm having the same problem where Photoshop window automatically reverts the Rectangle action. I usually put the window in the middle of the screen by using the shortcuts (Ctrl+Opt+C), and after doing so, it reverts the action after I do anything in Photoshop. Please see the attached screen recording. This has been going on for a while now.

rxhanson commented 9 months ago

@andrwmai Thanks for the screen recording. As mentioned in this thread, this issue is on Adobe's side unfortunately. Photoshop appears to have logic to maintain a window's size & position, and that logic is not aware of windows being placed using the Accessibility API (that all 3rd party window managers on macOS rely on).

andrwmai commented 9 months ago

@rxhanson thanks for the reply. Does this mean only Adobe can resolve this issue?

rxhanson commented 9 months ago

@andrwmai yes. The window resizing that you are experiencing when you do anything in Photoshop is not being performed by Rectangle. At this time, I'm not aware of a workaround that could even be done from Rectangle's side.

winskil commented 9 months ago

Noticed the same behaviour with Illustrator 2024 when using Rectangle's Maximize option. InDesign 2024 seems to have similar issues (the icons disappearing from the top left), however the window doesn't seem to resize.