unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs-desktop insists on having 13-pixel scrollbars at startup
@ 2024-04-20 12:31 PierGianLuca
  0 siblings, 0 replies; 8+ messages in thread
From: PierGianLuca @ 2024-04-20 12:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hi everyone.

Setup:

– Emacs 29.3 compiled on Ubuntu 20.04 from tarball, with options

./configure --with-native-compilation --with-json --enable-link-time-optimization --with-x-toolkit=gtk --with-xwidgets --without-toolkit-scroll-bars

– KDE Plasma desktop

– *No* window rules set for Emacs on KDE desktop

– *No* frame-geometry rules given to Emacs at startup in the emacs.desktop and emacsclient.desktop files

– early-init.el is empty

– default-frame-alist set, via customize, to:

  '(default-frame-alist
    '((horizontal-scroll-bars)
      (width . 87)
      (height . 80)
      (left . 1257)
      (top . 0)))


With this setup, Emacs starts with vertical scrollbars that are 13 pixels wide. If I create new frames with C-x 5 2 ('make-frame-command'), they also have 13-pixel-wide scrollbars.


I would like to change the scroll-bar width, adding 6 pixels. So I modify:

– early-init.el:

(setq-default scroll-bar-width 19)
(add-to-list 'initial-frame-alist '(scroll-bar-width . 19))


– default-frame-alist set, via customize, to:

  '(default-frame-alist
    '((horizontal-scroll-bars)
      (scroll-bar-width . 19)
      (width . 87)
      (height . 80)
      (left . 1257)
      (top . 0)))


What happens is that when I start Emacs, the *first* frames that appear have 13-pixels scrollbars. But any new frames that I create with 'make-frame-command' do have the requested 19-pixell scrollbars.


I discovered that this happens when Emacs-desktop is active. Emacs-desktop remembers the final frame geometry of all opened frames from one session to the next. Except that it always uses 13-pixel scrollbars for the restored frames when starting a new session. Frames created afterwards do have the correct scrollbar width – but they also will be reset to 13 pixels if Emacs is closed and started again.


If Emacs-desktop is disabled, Emacs starts with a frame having the required scrollbar width.


Is this a bug in Emacs Desktop, or am I missing or misunderstanding how it should work? I'm happy to share any other information you need.

Cheers!
Luca
  



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Emacs-desktop insists on having 13-pixel scrollbars at startup
@ 2024-04-28 19:57 Rahguzar
  2024-04-28 20:13 ` PierGianLuca
  0 siblings, 1 reply; 8+ messages in thread
From: Rahguzar @ 2024-04-28 19:57 UTC (permalink / raw)
  To: luca; +Cc: help-gnu-emacs

From info node `(emacs) Saving Emacs Sessions`

   When the desktop restores the frame and window configuration, it uses
the recorded values of frame parameters, disregarding any settings for
those parameters you have in your init file (*note Init File::).  This
means that frame parameters such as fonts and faces for the restored
frames will come from the desktop file, where they were saved when you
exited your previous Emacs session; any settings for those parameters in
your init file will be ignored.  To disable this, customize the value of
‘frameset-filter-alist’ to filter out the frame parameters you don’t
want to be restored; they will then be set according to your
customizations in the init file.

So you need to customize frameset-filter-alist



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs-desktop insists on having 13-pixel scrollbars at startup
  2024-04-28 19:57 Emacs-desktop insists on having 13-pixel scrollbars at startup Rahguzar
@ 2024-04-28 20:13 ` PierGianLuca
  2024-04-29  6:55   ` Eli Zaretskii
  2024-04-29  8:11   ` Rahguzar
  0 siblings, 2 replies; 8+ messages in thread
From: PierGianLuca @ 2024-04-28 20:13 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Rahguzar

Thank you. The problem is that the desktop is *not* using the recorded value of 'scroll-bar-width' (which is one frame parameter) from the session exited previously. Instead, it replaces it with 13 pixels, no matter what it was in the previous session.

In other words:

1. Suppose I have one frame that has width 90 (characters), height 14, and scroll-bar-width 30 pixels.

2. Now I close the Emacs session and the desktop is saved automatically.

3. I restart Emacs; desktop should restore the previous configuration:

– I expect: width 90, height 14, scroll-bar-width 30

– Instead I get: width 90, height 14, scroll-bar-width 13

This is why I see this as a bug.

Let me know if I'm misunderstanding something.

Cheers,
Luca


On 240428 21:57, Rahguzar wrote:
>  From info node `(emacs) Saving Emacs Sessions`
> 
>     When the desktop restores the frame and window configuration, it uses
> the recorded values of frame parameters, disregarding any settings for
> those parameters you have in your init file (*note Init File::).  This
> means that frame parameters such as fonts and faces for the restored
> frames will come from the desktop file, where they were saved when you
> exited your previous Emacs session; any settings for those parameters in
> your init file will be ignored.  To disable this, customize the value of
> ‘frameset-filter-alist’ to filter out the frame parameters you don’t
> want to be restored; they will then be set according to your
> customizations in the init file.
> 
> So you need to customize frameset-filter-alist



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs-desktop insists on having 13-pixel scrollbars at startup
  2024-04-28 20:13 ` PierGianLuca
@ 2024-04-29  6:55   ` Eli Zaretskii
  2024-04-29  7:16     ` PierGianLuca
  2024-04-29  8:11   ` Rahguzar
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-04-29  6:55 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 28 Apr 2024 22:13:07 +0200
> From: PierGianLuca <luca@magnaspesmeretrix.org>
> Cc: Rahguzar <rahguzar@zohomail.eu>
> 
> Thank you. The problem is that the desktop is *not* using the recorded value of 'scroll-bar-width' (which is one frame parameter) from the session exited previously. Instead, it replaces it with 13 pixels, no matter what it was in the previous session.
> 
> In other words:
> 
> 1. Suppose I have one frame that has width 90 (characters), height 14, and scroll-bar-width 30 pixels.
> 
> 2. Now I close the Emacs session and the desktop is saved automatically.
> 
> 3. I restart Emacs; desktop should restore the previous configuration:
> 
> – I expect: width 90, height 14, scroll-bar-width 30
> 
> – Instead I get: width 90, height 14, scroll-bar-width 13
> 
> This is why I see this as a bug.

I cannot reproduce this in Emacs 30: with the above recipe I get the
same scroll-bar-width as the value I set before quitting the session.
So please verify that Emacs restores the desktop from the correct file
(it could be modified via desktop-path), and if it does, then perhaps
this is specific to your Emacs configuration and/or the toolkit you
are using, or perhaps to some of your customizations.  I've reviewed
the code in frameset.el, and I don't see there anything that would
explain why scroll-bar-width frame-parameter would not be applied when
restoring the desktop.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs-desktop insists on having 13-pixel scrollbars at startup
  2024-04-29  6:55   ` Eli Zaretskii
@ 2024-04-29  7:16     ` PierGianLuca
  2024-04-29  8:20       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: PierGianLuca @ 2024-04-29  7:16 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Eli Zaretskii

Thank you Eli,

– Yes I'm sure about the correct desktop file. I can quit Emacs with very peculiar final configurations – many frames of very different, manually adjusted, size – but they are always correctly restored upon restart. Except the scroll-bar-width. If I delete the desktop file then Emacs doesn't remember the previous configuration.


– The scrollbar-width peculiarity happens with vv. 29.2/29.3 and

--with-x-toolkit=gtk --without-toolkit-scroll-bars

and also with

--with-x-toolkit=lucid --without-toolkit-scroll-bars

So it seems something peculiar to the "built-in" scrollbars. But I'll recompile without the "--without-toolkit-scroll-bars" and report what happens.

Cheers,
Luca



On 240429 08:55, Eli Zaretskii wrote:

> 
> I cannot reproduce this in Emacs 30: with the above recipe I get the
> same scroll-bar-width as the value I set before quitting the session.
> So please verify that Emacs restores the desktop from the correct file
> (it could be modified via desktop-path), and if it does, then perhaps
> this is specific to your Emacs configuration and/or the toolkit you
> are using, or perhaps to some of your customizations.  I've reviewed
> the code in frameset.el, and I don't see there anything that would
> explain why scroll-bar-width frame-parameter would not be applied when
> restoring the desktop.
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs-desktop insists on having 13-pixel scrollbars at startup
  2024-04-28 20:13 ` PierGianLuca
  2024-04-29  6:55   ` Eli Zaretskii
@ 2024-04-29  8:11   ` Rahguzar
  2024-04-29  8:16     ` PierGianLuca
  1 sibling, 1 reply; 8+ messages in thread
From: Rahguzar @ 2024-04-29  8:11 UTC (permalink / raw)
  To: PierGianLuca; +Cc: help-gnu-emacs

PierGianLuca <luca@magnaspesmeretrix.org> writes:

> Thank you. The problem is that the desktop is *not* using the recorded
> value of 'scroll-bar-width' (which is one frame parameter) from the
> session exited previously. Instead, it replaces it with 13 pixels, no
> matter what it was in the previous session.
>
> In other words:
>
> 1. Suppose I have one frame that has width 90 (characters), height 14, and scroll-bar-width 30 pixels.
>
> 2. Now I close the Emacs session and the desktop is saved automatically.
>
> 3. I restart Emacs; desktop should restore the previous configuration:
>
> – I expect: width 90, height 14, scroll-bar-width 30
>
> – Instead I get: width 90, height 14, scroll-bar-width 13
>
> This is why I see this as a bug.
>
> Let me know if I'm misunderstanding something.
>
> Cheers,
> Luca
>

I indeed misunderstood the problem you were describing. Sorry about that.

Rahguzar



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs-desktop insists on having 13-pixel scrollbars at startup
  2024-04-29  8:11   ` Rahguzar
@ 2024-04-29  8:16     ` PierGianLuca
  0 siblings, 0 replies; 8+ messages in thread
From: PierGianLuca @ 2024-04-29  8:16 UTC (permalink / raw)
  To: Rahguzar; +Cc: help-gnu-emacs

Hi Rahguzar, actually my first email wasn't very clear. Also, thank you for the pointer to the useful section in the Emacs manual!

I'll update after I test different compilation options.

Cheers,
Luca

On 240429 10:11, Rahguzar wrote:
> PierGianLuca <luca@magnaspesmeretrix.org> writes:
> 
>> Thank you. The problem is that the desktop is *not* using the recorded
>> value of 'scroll-bar-width' (which is one frame parameter) from the
>> session exited previously. Instead, it replaces it with 13 pixels, no
>> matter what it was in the previous session.
>>
>> In other words:
>>
>> 1. Suppose I have one frame that has width 90 (characters), height 14, and scroll-bar-width 30 pixels.
>>
>> 2. Now I close the Emacs session and the desktop is saved automatically.
>>
>> 3. I restart Emacs; desktop should restore the previous configuration:
>>
>> – I expect: width 90, height 14, scroll-bar-width 30
>>
>> – Instead I get: width 90, height 14, scroll-bar-width 13
>>
>> This is why I see this as a bug.
>>
>> Let me know if I'm misunderstanding something.
>>
>> Cheers,
>> Luca
>>
> 
> I indeed misunderstood the problem you were describing. Sorry about that.
> 
> Rahguzar



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs-desktop insists on having 13-pixel scrollbars at startup
  2024-04-29  7:16     ` PierGianLuca
@ 2024-04-29  8:20       ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2024-04-29  8:20 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 29 Apr 2024 09:16:45 +0200
> From: PierGianLuca <luca@magnaspesmeretrix.org>
> Cc: Eli Zaretskii <eliz@gnu.org>
> 
> – Yes I'm sure about the correct desktop file. I can quit Emacs with very peculiar final configurations – many frames of very different, manually adjusted, size – but they are always correctly restored upon restart. Except the scroll-bar-width. If I delete the desktop file then Emacs doesn't remember the previous configuration.
> 
> 
> – The scrollbar-width peculiarity happens with vv. 29.2/29.3 and
> 
> --with-x-toolkit=gtk --without-toolkit-scroll-bars
> 
> and also with
> 
> --with-x-toolkit=lucid --without-toolkit-scroll-bars
> 
> So it seems something peculiar to the "built-in" scrollbars. But I'll recompile without the "--without-toolkit-scroll-bars" and report what happens.

Thanks.  Please submit a bug report using report-emacs-bug, with all
the details, if you find this to happen in some particular
configurations.

FTR: it works for me in Emacs 29.3 as well.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-29  8:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-28 19:57 Emacs-desktop insists on having 13-pixel scrollbars at startup Rahguzar
2024-04-28 20:13 ` PierGianLuca
2024-04-29  6:55   ` Eli Zaretskii
2024-04-29  7:16     ` PierGianLuca
2024-04-29  8:20       ` Eli Zaretskii
2024-04-29  8:11   ` Rahguzar
2024-04-29  8:16     ` PierGianLuca
  -- strict thread matches above, loose matches on Subject: below --
2024-04-20 12:31 PierGianLuca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).