diff options
author | Noam Postavsky <npostavs@gmail.com> | 2018-01-26 20:45:38 -0500 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2018-01-26 20:45:38 -0500 |
commit | f5357b1ca4ae90e7ad6d8321884319cfdf828508 (patch) | |
tree | 5706d28900dd4f7441bae1629242a2ca029d645b /src | |
parent | c9a268552c8294bbca607da239528e6b89f8fb5b (diff) | |
parent | 463f96b4813fb77d88a7b0fa93f94aa08d71689f (diff) | |
download | emacs-f5357b1ca4ae90e7ad6d8321884319cfdf828508.tar.gz |
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) { if (f->size_hint_flags & (USPosition | PPosition)) { + int scale = xg_get_scale (f); #if ! GTK_CHECK_VERSION (3, 22, 0) if (x_gtk_use_window_move) { @@ -840,8 +841,9 @@ xg_set_geometry (struct frame *f) f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f)) - FRAME_PIXEL_HEIGHT (f) + f->top_pos); + /* GTK works in scaled pixels, so convert from X pixels. */ gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - f->left_pos, f->top_pos); + f->left_pos / scale, f->top_pos / scale); /* Reset size hint flags. */ f->size_hint_flags &= ~ (XNegative | YNegative); @@ -849,9 +851,10 @@ xg_set_geometry (struct frame *f) } else { - int left = f->left_pos; + /* GTK works in scaled pixels, so convert from X pixels. */ + int left = f->left_pos / scale; int xneg = f->size_hint_flags & XNegative; - int top = f->top_pos; + int top = f->top_pos / scale; int yneg = f->size_hint_flags & YNegative; char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; 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 connection; it is t for a pipe connection. If KEY is t, the complete contact information for the connection is returned, else the specific value for the keyword KEY is returned. See `make-network-process', -`make-serial-process', or `make pipe-process' for the list of keywords. +`make-serial-process', or `make-pipe-process' for the list of keywords. If PROCESS is a non-blocking network process that hasn't been fully set up yet, this function will block until socket setup has completed. */) (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, For example, if CHARACTER is a word constituent, the character `w' (119) is returned. The characters that correspond to various syntax codes -are listed in the documentation of `modify-syntax-entry'. */) +are listed in the documentation of `modify-syntax-entry'. + +If you're trying to determine the syntax of characters in the buffer, +this is probably the wrong function to use, because it can't take +`syntax-table' text properties into account. Consider using +`syntax-after' instead. */) (Lisp_Object character) { 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. */) gint width_mm = -1, height_mm = -1; GdkRectangle rec, work; struct MonitorInfo *mi = &monitors[i]; + int scale = 1; #if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); @@ -4983,6 +4984,16 @@ Internal use only, use `display-monitor-attributes-list' instead. */) } #endif + /* GTK returns scaled sizes for the workareas. */ +#if GTK_CHECK_VERSION (3, 22, 0) + scale = gdk_monitor_get_scale_factor (monitor); +#elif GTK_CHECK_VERSION (3, 10, 0) + scale = gdk_screen_get_monitor_scale_factor (gscreen, i); +#endif + rec.width *= scale; + rec.height *= scale; + work.width *= scale; + work.height *= scale; mi->geom.x = rec.x; 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 x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) { int modified_top, modified_left; +#ifdef USE_GTK + int scale = xg_get_scale (f); +#endif if (change_gravity > 0) { @@ -10323,11 +10326,12 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ if (x_gtk_use_window_move) { /* When a position change was requested and the outer GTK widget - has been realized already, leave it to gtk_window_move to DTRT - and return. Used for Bug#25851 and Bug#25943. */ + has been realized already, leave it to gtk_window_move to + DTRT and return. Used for Bug#25851 and Bug#25943. Convert + from X pixels to GTK scaled pixels. */ if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f)) gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - f->left_pos, f->top_pos); + f->left_pos / scale, f->top_pos / scale); unblock_input (); return; } @@ -10346,8 +10350,9 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ } #ifdef USE_GTK + /* Make sure we adjust for possible scaling. */ gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - modified_left, modified_top); + modified_left / scale, modified_top / scale); #else XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), modified_left, modified_top); |