From: "Jan Djärv" <jan.h.d@swipnet.se>
To: James Cloos <cloos@jhcloos.com>
Cc: martin rudalics <rudalics@gmx.at>,
Jonas Bernoulli <jonas@bernoul.li>,
emacs-devel@gnu.org
Subject: Re: size hints and tiling window managers
Date: Sat, 8 Dec 2012 10:15:23 +0100 [thread overview]
Message-ID: <6690A430-BFBF-4349-8ECF-AA2F5A163237@swipnet.se> (raw)
In-Reply-To: <m3ip8dtj3y.fsf@carbon.jhcloos.org>
Hello.
Min_height/width is not that important, they dont have to be a multiple of frame_height/width.
Not setting the height/width_inc would mean that Emacs resizes a pixel at a time, not a row/column at the time. And those window managers that provide resize feedback would be showing width x height as pixels instead of columns x rows. That would be a bigger bug IMHO, than having some pixels off at the edges.
Jan D.
8 dec 2012 kl. 02:42 skrev James Cloos <cloos@jhcloos.com>:
>>>>>> "mr" == martin rudalics <rudalics@gmx.at> writes:
>
> mr> Eli said that he can provide arbitrary frame pixel sizes at any time.
>
> Doesn't it just require not setting the .width_inc and .height_inc
> members of the size_hints struct in src/xterm.c and src/gtkutil.c,
> and editing the .min_width and .min_height code to account for that?
>
> Something like the (as yet untested, and X-only) code below?
>
> If so, I presume that it should be configurable, yes?
>
> That would require some effort to work out.
>
> -JimC
>
> === modified file 'src/gtkutil.c'
> --- src/gtkutil.c 2012-12-03 19:15:52 +0000
> +++ src/gtkutil.c 2012-12-08 01:35:39 +0000
> @@ -1357,9 +1357,7 @@
> size_hints = f->output_data.x->size_hints;
> hint_flags = f->output_data.x->hint_flags;
>
> - hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE;
> - size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
> - size_hints.height_inc = FRAME_LINE_HEIGHT (f);
> + hint_flags |= GDK_HINT_MIN_SIZE;
>
> hint_flags |= GDK_HINT_BASE_SIZE;
> /* Use one row/col here so base_height/width does not become zero.
> @@ -1374,8 +1372,8 @@
>
> size_hints.base_width = base_width;
> size_hints.base_height = base_height;
> - size_hints.min_width = base_width + min_cols * size_hints.width_inc;
> - size_hints.min_height = base_height + min_rows * size_hints.height_inc;
> + size_hints.min_width = base_width + min_cols * FRAME_COLUMN_WIDTH (f);
> + size_hints.min_height = base_height + min_rows * FRAME_LINE_HEIGHT (f);
>
> /* These currently have a one to one mapping with the X values, but I
> don't think we should rely on that. */
>
> === modified file 'src/xterm.c'
> --- src/xterm.c 2012-12-04 15:15:05 +0000
> +++ src/xterm.c 2012-12-08 01:34:26 +0000
> @@ -9534,8 +9534,6 @@
> size_hints.height = FRAME_PIXEL_HEIGHT (f);
> size_hints.width = FRAME_PIXEL_WIDTH (f);
>
> - size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
> - size_hints.height_inc = FRAME_LINE_HEIGHT (f);
> size_hints.max_width = x_display_pixel_width (FRAME_X_DISPLAY_INFO (f))
> - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
> size_hints.max_height = x_display_pixel_height (FRAME_X_DISPLAY_INFO (f))
> @@ -9564,8 +9562,8 @@
> size_hints.flags |= PBaseSize;
> size_hints.base_width = base_width;
> size_hints.base_height = base_height + FRAME_MENUBAR_HEIGHT (f);
> - size_hints.min_width = base_width + min_cols * size_hints.width_inc;
> - size_hints.min_height = base_height + min_rows * size_hints.height_inc;
> + size_hints.min_width = base_width + min_cols * FRAME_COLUMN_WIDTH (f);
> + size_hints.min_height = base_height + min_rows * FRAME_LINE_HEIGHT (f);
> }
>
> /* If we don't need the old flags, we don't need the old hint at all. */
>
>
>
> --
> James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
prev parent reply other threads:[~2012-12-08 9:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 18:55 size hints and tiling window managers Jonas Bernoulli
2012-12-07 10:35 ` martin rudalics
2012-12-07 10:45 ` Eli Zaretskii
2012-12-08 1:42 ` James Cloos
2012-12-08 9:01 ` Eli Zaretskii
2012-12-09 19:23 ` Jonas Bernoulli
2012-12-09 19:36 ` Eli Zaretskii
2012-12-15 23:33 ` Jonas Bernoulli
2012-12-16 4:42 ` Eli Zaretskii
2012-12-11 8:07 ` Giorgos Keramidas
2012-12-11 8:10 ` Eli Zaretskii
2012-12-08 9:15 ` Jan Djärv [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6690A430-BFBF-4349-8ECF-AA2F5A163237@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=cloos@jhcloos.com \
--cc=emacs-devel@gnu.org \
--cc=jonas@bernoul.li \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.