all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Question about child frames + menu bar
@ 2024-09-17  7:42 Gerd Möllmann
  2024-09-17 10:20 ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Möllmann @ 2024-09-17  7:42 UTC (permalink / raw)
  To: Martin Rudalics; +Cc: Emacs Devel

Hi Martin,

I've been playing with child frames on ttys again today, specifically
menus, and I think they work on root frames now, but not on child
frames.

The reason for that is that the child frames' menu_bar_items are always
nil which leads to an abort when trying to display a child frame's menu
bar. While investigating why the menu_bar_items are nil, I came across a
change in prepare_menu_bars, that I don't understand.

  93decaa131e3fc9de27b4f1fd5b56dc5f78ff198
  Author:     Martin Rudalics <rudalics@gmx.at>
  AuthorDate: Sat Apr 18 10:25:20 2020 +0200

This commit switches off calling update_menu_bar for child frames. When
I remove that switching off, menu_bar_items in child frames get set.
(There are still problems with the menu position, but that's for later.)

Do you perhaps remember what this change was about? I read the bug that
the commit message references but couldn't figure out how this bug is
related. Or, maybe, is there something special about menu bars on child
frames, like they may not have a menu bar, or something?

TIA



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

* Re: Question about child frames + menu bar
  2024-09-17  7:42 Question about child frames + menu bar Gerd Möllmann
@ 2024-09-17 10:20 ` martin rudalics
  2024-09-17 10:47   ` Gerd Möllmann
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2024-09-17 10:20 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: Emacs Devel

 > Do you perhaps remember what this change was about? I read the bug that
 > the commit message references but couldn't figure out how this bug is
 > related. Or, maybe, is there something special about menu bars on child
 > frames, like they may not have a menu bar, or something?

As far as this change for the selected frame case

-      update_menu_bar (sf, true, false);
+
+      if (!FRAME_PARENT_FRAME (sf))
+	update_menu_bar (sf, true, false);

is concerned, I can only guess that when I tried to fix the bug above I
noticed that we did call update_menu_bar for the case that the selected
frame is a child frame and tried to avoid that.  The rationale was that
when I implemented child frames, I noticed that menu bars don't work
with child frames under X while they worked well on MS Windows.  Now at
that time there was a strict policy that we were not allowed to
implement features that worked on non-free systems only.  So I switched
off menu bars in child frames everywhere and made the change above to be
on the safe side.

If you want to implement menu bars on TTY child frames, you probably
will have to special case that here and maybe in other places as well.

martin



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

* Re: Question about child frames + menu bar
  2024-09-17 10:20 ` martin rudalics
@ 2024-09-17 10:47   ` Gerd Möllmann
  2024-09-17 13:25     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Möllmann @ 2024-09-17 10:47 UTC (permalink / raw)
  To: martin rudalics; +Cc: Emacs Devel

martin rudalics <rudalics@gmx.at> writes:

>> Do you perhaps remember what this change was about? I read the bug that
>> the commit message references but couldn't figure out how this bug is
>> related. Or, maybe, is there something special about menu bars on child
>> frames, like they may not have a menu bar, or something?
>
> As far as this change for the selected frame case
>
> -      update_menu_bar (sf, true, false);
> +
> +      if (!FRAME_PARENT_FRAME (sf))
> +	update_menu_bar (sf, true, false);
>
> is concerned, I can only guess that when I tried to fix the bug above I
> noticed that we did call update_menu_bar for the case that the selected
> frame is a child frame and tried to avoid that.  The rationale was that
> when I implemented child frames, I noticed that menu bars don't work
> with child frames under X while they worked well on MS Windows.  Now at
> that time there was a strict policy that we were not allowed to
> implement features that worked on non-free systems only.  So I switched
> off menu bars in child frames everywhere and made the change above to be
> on the safe side.

Thanks, that explains it, I guess, although on macOS child frames seem
to support menus, heaven knows how that works.

> If you want to implement menu bars on TTY child frames, you probably
> will have to special case that here and maybe in other places as well.

Hm, not sure what I should do.

On one hand, I could suppress the menu bar on chlid frames in some way,
which would hopefully be easy (haven't looked, but maybe not accepting
menu-bar-lines changes to non-zero.

Or I could make the condition "!PARENT_FRAME || on tty" plus fix the
menu position bug. Should also not be too difficult I guess, but a bit
more work.

Any preferences, anyone?



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

* Re: Question about child frames + menu bar
  2024-09-17 10:47   ` Gerd Möllmann
@ 2024-09-17 13:25     ` Eli Zaretskii
  2024-09-17 14:49       ` Gerd Möllmann
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-09-17 13:25 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: rudalics, emacs-devel

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: Emacs Devel <emacs-devel@gnu.org>
> Date: Tue, 17 Sep 2024 12:47:24 +0200
> 
> martin rudalics <rudalics@gmx.at> writes:
> 
> >> Do you perhaps remember what this change was about? I read the bug that
> >> the commit message references but couldn't figure out how this bug is
> >> related. Or, maybe, is there something special about menu bars on child
> >> frames, like they may not have a menu bar, or something?
> >
> > As far as this change for the selected frame case
> >
> > -      update_menu_bar (sf, true, false);
> > +
> > +      if (!FRAME_PARENT_FRAME (sf))
> > +	update_menu_bar (sf, true, false);
> >
> > is concerned, I can only guess that when I tried to fix the bug above I
> > noticed that we did call update_menu_bar for the case that the selected
> > frame is a child frame and tried to avoid that.  The rationale was that
> > when I implemented child frames, I noticed that menu bars don't work
> > with child frames under X while they worked well on MS Windows.  Now at
> > that time there was a strict policy that we were not allowed to
> > implement features that worked on non-free systems only.  So I switched
> > off menu bars in child frames everywhere and made the change above to be
> > on the safe side.
> 
> Thanks, that explains it, I guess, although on macOS child frames seem
> to support menus, heaven knows how that works.
> 
> > If you want to implement menu bars on TTY child frames, you probably
> > will have to special case that here and maybe in other places as well.
> 
> Hm, not sure what I should do.
> 
> On one hand, I could suppress the menu bar on chlid frames in some way,
> which would hopefully be easy (haven't looked, but maybe not accepting
> menu-bar-lines changes to non-zero.
> 
> Or I could make the condition "!PARENT_FRAME || on tty" plus fix the
> menu position bug. Should also not be too difficult I guess, but a bit
> more work.
> 
> Any preferences, anyone?

Are menu bars on child frame useful? what for?

If they are not very useful (and it seems like they aren't given that
we didn't have too many complaints), then I guess leaving them
disabled on TTY child frames would be okay.



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

* Re: Question about child frames + menu bar
  2024-09-17 13:25     ` Eli Zaretskii
@ 2024-09-17 14:49       ` Gerd Möllmann
  0 siblings, 0 replies; 5+ messages in thread
From: Gerd Möllmann @ 2024-09-17 14:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rudalics, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> Any preferences, anyone?
>
> Are menu bars on child frame useful? what for?
>
> If they are not very useful (and it seems like they aren't given that
> we didn't have too many complaints), then I guess leaving them
> disabled on TTY child frames would be okay.

Ok, thanks. I'll go with disabling the menu bars on child frames, I
think.



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

end of thread, other threads:[~2024-09-17 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17  7:42 Question about child frames + menu bar Gerd Möllmann
2024-09-17 10:20 ` martin rudalics
2024-09-17 10:47   ` Gerd Möllmann
2024-09-17 13:25     ` Eli Zaretskii
2024-09-17 14:49       ` Gerd Möllmann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.