alphapapa / ement.el

A Matrix client for GNU Emacs
GNU General Public License v3.0
476 stars 44 forks source link

ement-room-image-show unconditionally sets fullscreen frame-parameter #223

Closed progfolio closed 9 months ago

progfolio commented 9 months ago

OS/platform

Arch linux

Emacs version and provenance

GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-09-20 From arch user repository.

Emacs command

emacs

Emacs frame type

GUI

Actions taken

  1. Customize display-buffer-alist to prevent ement images from displaying in a new frame:
  (add-to-list 'display-buffer-alist
               (cons "^\\*Ement image: "
                     (cons 'display-buffer-below-selected
                           '((inhibit-same-window . t)
                             (reusable-frames . nil)))))
  1. Invoke ement-room-image-show on an image in any room.

Results

The altered display-buffer-alist rule is obeyed, but the current frame is resized.

Expected results

The frame should retain it's dimensions.

Backtrace

No response

Etc.

ement.el @ commit: 52faf4a

In ement-room-image-show:

    (pop-to-buffer new-buffer '((display-buffer-pop-up-frame)))
    (set-frame-parameter nil 'fullscreen 'maximized)))

would it be possible to set the frame parameter as part of the ACTION argument to pop-to-buffer?

alphapapa commented 9 months ago

Probably the ACTION argument to pop-to-buffer should be in a defcustom, and the frame parameters should be passed in it via pop-up-frame-parameters (cf. Elisp manual 29.13.3).

alphapapa commented 9 months ago

@progfolio Tag, you're it. ;)

progfolio commented 9 months ago

Probably the ACTION argument to pop-to-buffer should be in a defcustom

I don't think this would be necessary if the ACTION specifies the parameters. That part could still be overridden in display-buffer-alist.

the frame parameters should be passed in it via pop-up-frame-parameters (cf. Elisp manual 29.13.3).

Thanks for hunting down that section of the manual. Let me know what you think of #225.

My current config:

(add-to-list 'display-buffer-alist
               (cons "^\\*Ement image: "
                     (cons 'display-buffer-below-selected
                           '((inhibit-same-window . t)
                             (reusable-frames . nil)))))
alphapapa commented 9 months ago

Merged the PR as-is. Let me know if it needs anything else. Thanks.