diff options
| author | Noam Postavsky | 2018-01-26 20:45:38 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2018-01-26 20:45:38 -0500 |
| commit | f5357b1ca4ae90e7ad6d8321884319cfdf828508 (patch) | |
| tree | 5706d28900dd4f7441bae1629242a2ca029d645b /src | |
| parent | c9a268552c8294bbca607da239528e6b89f8fb5b (diff) | |
| parent | 463f96b4813fb77d88a7b0fa93f94aa08d71689f (diff) | |
| download | emacs-f5357b1ca4ae90e7ad6d8321884319cfdf828508.tar.gz emacs-f5357b1ca4ae90e7ad6d8321884319cfdf828508.zip | |
Merge from emacs-26
463f96b481 * doc/lispref/searching.texi: Document regexp repetition l...
08a6195571 ; test/README: Document TEST_LOAD_EL parameter.
7bbea90b1a * src/syntax.c (char-syntax): Warn about ignoring text pro...
50fcbb5f61 ; * src/process.c (Fprocess_contact): Fix docstring typo.
81ae9c8c05 Load mm-util as needed for url-file and url-data (Bug#30258)
5a1ee67ae1 Another minor copyedit in the manual's "Scroll Bars"
226a651e9e Minor fix in documentation of 'equal'
b26786c8d9 * lisp/dired-x.el (dired-guess-shell-alist-user): Doc fix....
5699a824f0 Minor rewording in Emacs manual's "Help Mode" node
f35ff0156e Fixes for Emacs manual in frames.texi
6cd4e8dcc5 * doc/misc/cl.texi (Efficiency Concerns): Fix 2012-10-27 t...
1412cf3edd Fix a few issues with latest GTK scaling changes
59db8dca03 Use scaled coordinates when calling into GTK
2892f05792 Scale monitor dimensions obtained from GTK
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtkutil.c | 9 | ||||
| -rw-r--r-- | src/process.c | 2 | ||||
| -rw-r--r-- | src/syntax.c | 7 | ||||
| -rw-r--r-- | src/xfns.c | 11 | ||||
| -rw-r--r-- | src/xterm.c | 13 |
5 files changed, 33 insertions, 9 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 825651cf083..3f21288f461 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -825,6 +825,7 @@ xg_set_geometry (struct frame *f) | |||
| 825 | { | 825 | { |
| 826 | if (f->size_hint_flags & (USPosition | PPosition)) | 826 | if (f->size_hint_flags & (USPosition | PPosition)) |
| 827 | { | 827 | { |
| 828 | int scale = xg_get_scale (f); | ||
| 828 | #if ! GTK_CHECK_VERSION (3, 22, 0) | 829 | #if ! GTK_CHECK_VERSION (3, 22, 0) |
| 829 | if (x_gtk_use_window_move) | 830 | if (x_gtk_use_window_move) |
| 830 | { | 831 | { |
| @@ -840,8 +841,9 @@ xg_set_geometry (struct frame *f) | |||
| 840 | f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f)) | 841 | f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f)) |
| 841 | - FRAME_PIXEL_HEIGHT (f) + f->top_pos); | 842 | - FRAME_PIXEL_HEIGHT (f) + f->top_pos); |
| 842 | 843 | ||
| 844 | /* GTK works in scaled pixels, so convert from X pixels. */ | ||
| 843 | gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 845 | gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 844 | f->left_pos, f->top_pos); | 846 | f->left_pos / scale, f->top_pos / scale); |
| 845 | 847 | ||
| 846 | /* Reset size hint flags. */ | 848 | /* Reset size hint flags. */ |
| 847 | f->size_hint_flags &= ~ (XNegative | YNegative); | 849 | f->size_hint_flags &= ~ (XNegative | YNegative); |
| @@ -849,9 +851,10 @@ xg_set_geometry (struct frame *f) | |||
| 849 | } | 851 | } |
| 850 | else | 852 | else |
| 851 | { | 853 | { |
| 852 | int left = f->left_pos; | 854 | /* GTK works in scaled pixels, so convert from X pixels. */ |
| 855 | int left = f->left_pos / scale; | ||
| 853 | int xneg = f->size_hint_flags & XNegative; | 856 | int xneg = f->size_hint_flags & XNegative; |
| 854 | int top = f->top_pos; | 857 | int top = f->top_pos / scale; |
| 855 | int yneg = f->size_hint_flags & YNegative; | 858 | int yneg = f->size_hint_flags & YNegative; |
| 856 | char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; | 859 | char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; |
| 857 | guint id; | 860 | guint id; |
diff --git a/src/process.c b/src/process.c index daa0dc68ae6..ff3edbb11a0 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1437,7 +1437,7 @@ optional KEY arg. If KEY is nil, value is a cons cell of the form | |||
| 1437 | connection; it is t for a pipe connection. If KEY is t, the complete | 1437 | connection; it is t for a pipe connection. If KEY is t, the complete |
| 1438 | contact information for the connection is returned, else the specific | 1438 | contact information for the connection is returned, else the specific |
| 1439 | value for the keyword KEY is returned. See `make-network-process', | 1439 | value for the keyword KEY is returned. See `make-network-process', |
| 1440 | `make-serial-process', or `make pipe-process' for the list of keywords. | 1440 | `make-serial-process', or `make-pipe-process' for the list of keywords. |
| 1441 | If PROCESS is a non-blocking network process that hasn't been fully | 1441 | If PROCESS is a non-blocking network process that hasn't been fully |
| 1442 | set up yet, this function will block until socket setup has completed. */) | 1442 | set up yet, this function will block until socket setup has completed. */) |
| 1443 | (Lisp_Object process, Lisp_Object key) | 1443 | (Lisp_Object process, Lisp_Object key) |
diff --git a/src/syntax.c b/src/syntax.c index a7977666593..52cec23cd7e 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -1108,7 +1108,12 @@ DEFUN ("char-syntax", Fchar_syntax, Schar_syntax, 1, 1, 0, | |||
| 1108 | For example, if CHARACTER is a word constituent, the | 1108 | For example, if CHARACTER is a word constituent, the |
| 1109 | character `w' (119) is returned. | 1109 | character `w' (119) is returned. |
| 1110 | The characters that correspond to various syntax codes | 1110 | The characters that correspond to various syntax codes |
| 1111 | are listed in the documentation of `modify-syntax-entry'. */) | 1111 | are listed in the documentation of `modify-syntax-entry'. |
| 1112 | |||
| 1113 | If you're trying to determine the syntax of characters in the buffer, | ||
| 1114 | this is probably the wrong function to use, because it can't take | ||
| 1115 | `syntax-table' text properties into account. Consider using | ||
| 1116 | `syntax-after' instead. */) | ||
| 1112 | (Lisp_Object character) | 1117 | (Lisp_Object character) |
| 1113 | { | 1118 | { |
| 1114 | int char_int; | 1119 | int char_int; |
diff --git a/src/xfns.c b/src/xfns.c index 43c55cca643..92cd12be164 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -4938,6 +4938,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) | |||
| 4938 | gint width_mm = -1, height_mm = -1; | 4938 | gint width_mm = -1, height_mm = -1; |
| 4939 | GdkRectangle rec, work; | 4939 | GdkRectangle rec, work; |
| 4940 | struct MonitorInfo *mi = &monitors[i]; | 4940 | struct MonitorInfo *mi = &monitors[i]; |
| 4941 | int scale = 1; | ||
| 4941 | 4942 | ||
| 4942 | #if GTK_CHECK_VERSION (3, 22, 0) | 4943 | #if GTK_CHECK_VERSION (3, 22, 0) |
| 4943 | GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); | 4944 | GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); |
| @@ -4983,6 +4984,16 @@ Internal use only, use `display-monitor-attributes-list' instead. */) | |||
| 4983 | } | 4984 | } |
| 4984 | #endif | 4985 | #endif |
| 4985 | 4986 | ||
| 4987 | /* GTK returns scaled sizes for the workareas. */ | ||
| 4988 | #if GTK_CHECK_VERSION (3, 22, 0) | ||
| 4989 | scale = gdk_monitor_get_scale_factor (monitor); | ||
| 4990 | #elif GTK_CHECK_VERSION (3, 10, 0) | ||
| 4991 | scale = gdk_screen_get_monitor_scale_factor (gscreen, i); | ||
| 4992 | #endif | ||
| 4993 | rec.width *= scale; | ||
| 4994 | rec.height *= scale; | ||
| 4995 | work.width *= scale; | ||
| 4996 | work.height *= scale; | ||
| 4986 | 4997 | ||
| 4987 | mi->geom.x = rec.x; | 4998 | mi->geom.x = rec.x; |
| 4988 | mi->geom.y = rec.y; | 4999 | mi->geom.y = rec.y; |
diff --git a/src/xterm.c b/src/xterm.c index 0a2068d7f30..7603e4f3991 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10301,6 +10301,9 @@ void | |||
| 10301 | x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) | 10301 | x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) |
| 10302 | { | 10302 | { |
| 10303 | int modified_top, modified_left; | 10303 | int modified_top, modified_left; |
| 10304 | #ifdef USE_GTK | ||
| 10305 | int scale = xg_get_scale (f); | ||
| 10306 | #endif | ||
| 10304 | 10307 | ||
| 10305 | if (change_gravity > 0) | 10308 | if (change_gravity > 0) |
| 10306 | { | 10309 | { |
| @@ -10323,11 +10326,12 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ | |||
| 10323 | if (x_gtk_use_window_move) | 10326 | if (x_gtk_use_window_move) |
| 10324 | { | 10327 | { |
| 10325 | /* When a position change was requested and the outer GTK widget | 10328 | /* When a position change was requested and the outer GTK widget |
| 10326 | has been realized already, leave it to gtk_window_move to DTRT | 10329 | has been realized already, leave it to gtk_window_move to |
| 10327 | and return. Used for Bug#25851 and Bug#25943. */ | 10330 | DTRT and return. Used for Bug#25851 and Bug#25943. Convert |
| 10331 | from X pixels to GTK scaled pixels. */ | ||
| 10328 | if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f)) | 10332 | if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f)) |
| 10329 | gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 10333 | gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 10330 | f->left_pos, f->top_pos); | 10334 | f->left_pos / scale, f->top_pos / scale); |
| 10331 | unblock_input (); | 10335 | unblock_input (); |
| 10332 | return; | 10336 | return; |
| 10333 | } | 10337 | } |
| @@ -10346,8 +10350,9 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ | |||
| 10346 | } | 10350 | } |
| 10347 | 10351 | ||
| 10348 | #ifdef USE_GTK | 10352 | #ifdef USE_GTK |
| 10353 | /* Make sure we adjust for possible scaling. */ | ||
| 10349 | gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 10354 | gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 10350 | modified_left, modified_top); | 10355 | modified_left / scale, modified_top / scale); |
| 10351 | #else | 10356 | #else |
| 10352 | XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 10357 | XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 10353 | modified_left, modified_top); | 10358 | modified_left, modified_top); |