GNU bug report logs -
#14233
24.3; Don't constrain frame size to character multiples
Previous Next
Reported by: E Sabof <esabof <at> gmail.com>
Date: Sat, 20 Apr 2013 00:04:02 UTC
Severity: wishlist
Found in version 24.3
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
Full log
Message #176 received at 14233 <at> debbugs.gnu.org (full text, mbox):
> Date: Tue, 23 Apr 2013 08:52:08 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> CC: jan.h.d <at> swipnet.se, esabof <at> gmail.com, 14233 <at> debbugs.gnu.org
>
> >> change_frame_size has no idea whether it is called for a text or a
> >> graphical frame.
> >
> > That is done very easily, given the frame pointer (which
> > change_frame_size accepts as its 1st argument). E.g.:
> >
> > if (FRAME_WINDOW_P (f))
> > /* do the GUI thing */
>
> A couple of weeks ago I asked you whether HAVE_WINDOW_SYSTEM would be
> sufficient but got no answer :-( The problem is that I'm still not sure
> whether FRAME_WINDOW_P is sufficient. At least in frame.c all
> FRAME_WINDOW_P calls are guarded by HAVE_WINDOW_SYSTEM checks as
>
> #ifdef HAVE_WINDOW_SYSTEM
> if (FRAME_WINDOW_P (XFRAME (this)))
> ...
> #endif
That's because the members of 'struct frame' that are tested by
FRAME_WINDOW_P do not exist unless HAVE_WINDOW_SYSTEM is defined.
Emacs caters to TTY frames both in a build --without-x, where
HAVE_WINDOW_SYSTEM is not defined and none of the X code is compiled;
and in a build that does support GUI frames, but just created a
text-mode frame for some reason. Thus the need to have the code both
ifdef'ed away at compile time and tested at run time.
> so some doubt remains whether this predicate is correctly installed on
> every platform.
There's no doubt: it is, as described above.
> In any case I'd want either an #ifdef or a simple and robust
> predicate without having to care about #ifdefs.
Sorry, you can't, not with the current infrastructure. You must do it
with a predicate that is also protected with an ifdef.
> >> Text frames might want to call it as before using character sizes.
> >
> > On text-mode frames, each character is one pixel. Emacs knows that
> > already.
>
> In the past weeks I started to doubt whether Emacs really knows
> everything it pretends to know.
Maybe so, but "1 character == 1 pixel on TTY frames" does not belong
to any gray areas.
> >> In any case, the callers have to strip space used for tool- or
> >> menubars because change_frame_size does not know whether these are
> >> part of the frame or not.
> >
> > Why can't change_frame_size know that?
>
> The callers should know best whether a toolbar is part of their frames
> or not. But we could obviously teach change_frame_size to check that.
I think all the information is already stored in the frame object.
This bug report was last modified 10 years and 154 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.