diff options
| author | Po Lu | 2022-02-17 10:28:02 +0800 |
|---|---|---|
| committer | Po Lu | 2022-02-17 10:28:02 +0800 |
| commit | 74c07733698b95eb455edcafab8634a700a3194f (patch) | |
| tree | 49f841e8ec56c27f0441bb456a5eb4332f65f447 /src | |
| parent | e14317eec4461e86a93906973ff99527e7dfa4df (diff) | |
| download | emacs-74c07733698b95eb455edcafab8634a700a3194f.tar.gz emacs-74c07733698b95eb455edcafab8634a700a3194f.zip | |
* src/emacsgtkfixed.c (XSetWMSizeHints): Improve fix for bug#8919.
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacsgtkfixed.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index a38ba35ad80..cd5d1d14353 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c | |||
| @@ -164,11 +164,30 @@ XSetWMSizeHints (Display *d, | |||
| 164 | 164 | ||
| 165 | if ((hints->flags & PMinSize) && f) | 165 | if ((hints->flags & PMinSize) && f) |
| 166 | { | 166 | { |
| 167 | int w = f->output_data.x->size_hints.min_width; | 167 | /* Overriding the size hints with our own values of min_width |
| 168 | int h = f->output_data.x->size_hints.min_height; | 168 | and min_height used to work, but these days just results in |
| 169 | 169 | frames resizing unpredictably and emitting GTK warnings while | |
| 170 | data[5] = w; | 170 | Emacs fights with GTK over the size of the frame. So instead |
| 171 | data[6] = h; | 171 | of doing that, just respect the hints set by GTK, but make |
| 172 | sure they are an integer multiple of the resize increments so | ||
| 173 | that bug#8919 stays fixed. */ | ||
| 174 | |||
| 175 | /* int w = f->output_data.x->size_hints.min_width; | ||
| 176 | int h = f->output_data.x->size_hints.min_height; | ||
| 177 | |||
| 178 | data[5] = w; | ||
| 179 | data[6] = h; */ | ||
| 180 | |||
| 181 | /* Make sure min_width and min_height are multiples of width_inc | ||
| 182 | and height_inc. */ | ||
| 183 | |||
| 184 | if (hints->flags & PResizeInc) | ||
| 185 | { | ||
| 186 | if (data[5] % hints->width_inc) | ||
| 187 | data[5] += (hints->width_inc - (data[5] % hints->width_inc)); | ||
| 188 | if (data[6] % hints->height_inc) | ||
| 189 | data[6] += (hints->height_inc - (data[6] % hints->height_inc)); | ||
| 190 | } | ||
| 172 | } | 191 | } |
| 173 | 192 | ||
| 174 | XChangeProperty (d, w, prop, XA_WM_SIZE_HINTS, 32, PropModeReplace, | 193 | XChangeProperty (d, w, prop, XA_WM_SIZE_HINTS, 32, PropModeReplace, |