diff options
| author | Po Lu | 2022-01-23 09:14:16 +0800 |
|---|---|---|
| committer | Po Lu | 2022-01-23 09:14:16 +0800 |
| commit | 7c16f691011deb0843ea8d7c8324aca034cbd56c (patch) | |
| tree | df459bf2264e89dc9474f9fbf32e7112f1d8ceb5 /src | |
| parent | 27e080d009076c4c7482201987af36d423a75b61 (diff) | |
| download | emacs-7c16f691011deb0843ea8d7c8324aca034cbd56c.tar.gz emacs-7c16f691011deb0843ea8d7c8324aca034cbd56c.zip | |
Clean up some of the X extension related code
* src/image.c (Fimage_transforms_p): Remove unused variables.
* src/xterm.c (x_probe_xfixes_extension):
(x_term_init): Probe for xfixes during terminal initialization
instead.
* src/xterm.h (struct x_display_info): New fields for xfixes
support.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 2 | ||||
| -rw-r--r-- | src/xterm.c | 22 | ||||
| -rw-r--r-- | src/xterm.h | 6 |
3 files changed, 26 insertions, 4 deletions
diff --git a/src/image.c b/src/image.c index ce9af2dd677..7ee595297fa 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -11195,8 +11195,6 @@ The list of capabilities can include one or more of the following: | |||
| 11195 | || defined (HAVE_HAIKU) | 11195 | || defined (HAVE_HAIKU) |
| 11196 | return list2 (Qscale, Qrotate90); | 11196 | return list2 (Qscale, Qrotate90); |
| 11197 | # elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER) | 11197 | # elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER) |
| 11198 | int event_basep, error_basep; | ||
| 11199 | |||
| 11200 | if (FRAME_DISPLAY_INFO (f)->xrender_supported_p) | 11198 | if (FRAME_DISPLAY_INFO (f)->xrender_supported_p) |
| 11201 | return list2 (Qscale, Qrotate90); | 11199 | return list2 (Qscale, Qrotate90); |
| 11202 | # elif defined (HAVE_NTGUI) | 11200 | # elif defined (HAVE_NTGUI) |
diff --git a/src/xterm.c b/src/xterm.c index 36e0045d2ed..2a4ea883bc1 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -14920,8 +14920,12 @@ static bool | |||
| 14920 | x_probe_xfixes_extension (Display *dpy) | 14920 | x_probe_xfixes_extension (Display *dpy) |
| 14921 | { | 14921 | { |
| 14922 | #ifdef HAVE_XFIXES | 14922 | #ifdef HAVE_XFIXES |
| 14923 | int major, minor; | 14923 | struct x_display_info *info |
| 14924 | return XFixesQueryVersion (dpy, &major, &minor) && major >= 4; | 14924 | = x_display_info_for_display (dpy); |
| 14925 | |||
| 14926 | return (info | ||
| 14927 | && info->xfixes_supported_p | ||
| 14928 | && info->xfixes_major >= 4); | ||
| 14925 | #else | 14929 | #else |
| 14926 | return false; | 14930 | return false; |
| 14927 | #endif /* HAVE_XFIXES */ | 14931 | #endif /* HAVE_XFIXES */ |
| @@ -15431,6 +15435,20 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 15431 | } | 15435 | } |
| 15432 | #endif | 15436 | #endif |
| 15433 | 15437 | ||
| 15438 | #ifdef HAVE_XFIXES | ||
| 15439 | int xfixes_event_base, xfixes_error_base; | ||
| 15440 | dpyinfo->xfixes_supported_p | ||
| 15441 | = XFixesQueryExtension (dpyinfo->display, &xfixes_event_base, | ||
| 15442 | &xfixes_error_base); | ||
| 15443 | |||
| 15444 | if (dpyinfo->xfixes_supported_p) | ||
| 15445 | { | ||
| 15446 | if (!XFixesQueryVersion (dpyinfo->display, &dpyinfo->xfixes_major, | ||
| 15447 | &dpyinfo->xfixes_minor)) | ||
| 15448 | dpyinfo->xfixes_supported_p = false; | ||
| 15449 | } | ||
| 15450 | #endif | ||
| 15451 | |||
| 15434 | #if defined USE_CAIRO || defined HAVE_XFT | 15452 | #if defined USE_CAIRO || defined HAVE_XFT |
| 15435 | { | 15453 | { |
| 15436 | /* If we are using Xft, the following precautions should be made: | 15454 | /* If we are using Xft, the following precautions should be made: |
diff --git a/src/xterm.h b/src/xterm.h index 26b2851590d..a4ad57eddaa 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -546,6 +546,12 @@ struct x_display_info | |||
| 546 | int xrender_major; | 546 | int xrender_major; |
| 547 | int xrender_minor; | 547 | int xrender_minor; |
| 548 | #endif | 548 | #endif |
| 549 | |||
| 550 | #ifdef HAVE_XFIXES | ||
| 551 | bool xfixes_supported_p; | ||
| 552 | int xfixes_major; | ||
| 553 | int xfixes_minor; | ||
| 554 | #endif | ||
| 549 | }; | 555 | }; |
| 550 | 556 | ||
| 551 | #ifdef HAVE_X_I18N | 557 | #ifdef HAVE_X_I18N |