Skip to content

Drag snap not working with Emacs #591

Closed

Description

@quot
  • This is a new bug that hasn't been documented in a closed issue or in the Readme.

macOS version: 11.5.2
Rectangle version: 0.48 (Installed through Brew)
Emacs version: 28 - Installed through Brew's emacs-nightly cask package.

Dragging Emacs to the sides of the screen does not cause Rectangle to draw the gray window outline or snap the window like other programs would. I am able to resize and move Emacs using the Menu Bar icon's snapping buttons.

Activity

  1. added
    bug
    on Oct 4, 2021
  2. rxhanson commented on Oct 4, 2021

    @rxhanson
    Owner

    There's likely nothing that can be done Rectangle side for this, but I'll take another look at the logic and see if I can come up with a workaround. What's happening is that Rectangle grabs the accessibility element needed for window control on either down click or drag events, and Emacs likely does something different that doesn't readily provide the accessibility element.

  3. amit-mondal commented on Dec 30, 2021

    @amit-mondal

    For what it's worth, BetterTouchTool seems to be able to snap Emacs windows - perhaps it might be worth seeing how that works?

  4. andrewmzhang commented on Jun 14, 2025

    @andrewmzhang

    EDIT 2026-04-26: I noticed that the "Ignore Emacs" was checked in the Rectangle drop down menu. I must've checked that option inadvertently, cause I don't remember doing that. I think unchecking that kinda fixed Rectangle+Emacs w/o messing with the Info.plist file

    EDIT on 2026-04-09: I think this has to do w/ the fact that emacs runs a daemon. I think changing the CFBundleIdentifier changes how the OS "sees" the window...

    EDIT: I just did some reading on what Info.plist even is (I'm not an OSX developer). Turns out this method is basically just unbundling the app so we skip some security checks? Not sure if this approach to "fixing" emacs is valid.

    I believe I've found and fixed a similar bug with the Emacs GUI client

    System

    macOS Version: 15.5
    Rectangle Pro Version: 3.53
    Emacs Version: 3.1.0 (although the issue persists on other versions, including 2.9 and 3.1.9). I compiled this myself

    Problem

    After compiling, the produced binary emacs_repo/src/emacs works fine. Dragging the window slightly produces the little floating menu1 where you can snap & resize the emacs window.

    Running make install produces emacs_repo/nextstep/Emacs.app/ that you can drag into the /Applications/ folder. It's this version of emacs that will not produce the floating menu when dragged. Rectangle Menu -> Resize and Snap still works. Looking at the logs, this version of emacs does not produce these lines:

    2025-06-13T22:39:48-05:00: Updating visible window info
    

    Fix

    Open emacs_repo/nextstep/Emacs.app/Contents/MacOS/Info.plist in an editor, and find these lines:

    <key>CFBundleIdentifier</key>
    <string>org.gnu.Emacs</string>  
    

    Rename org.gnu.Emacs to something else, like org.gnu.Emacs123. Launch emacs again and it should now produce the little floating menu when its window is dragged. The debug low shows Updating visible window info events again!

    I have no idea why this works or what's so special about org.gnu.Emacs that makes its window events invisible to Rectangle Pro... I'll update this thread if changing the CFBundleIdentifier causes some sort of other issues

    Footnotes

    1. This is what I mean by floating menu: Image ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions