aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-02-21 07:42:01 +0000
committerPo Lu2022-02-21 07:42:01 +0000
commitfc281e0df3d6f3ea359eae440cdae7e65412c06d (patch)
treecf6ca6c76a31be53752fd27e0c01b82858f69093 /src
parente087c89b1e243bbd941a4a50b4bf99613e13d016 (diff)
downloademacs-fc281e0df3d6f3ea359eae440cdae7e65412c06d.tar.gz
emacs-fc281e0df3d6f3ea359eae440cdae7e65412c06d.zip
Prevent Haiku display from being opened multiple times
* src/haikufns.c (Fx_open_connection): Return if display connection already exists.
Diffstat (limited to 'src')
-rw-r--r--src/haikufns.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/haikufns.c b/src/haikufns.c
index ea42dd0daa6..69f502fb016 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -1844,16 +1844,29 @@ DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection,
1844 doc: /* SKIP: real doc in xfns.c. */) 1844 doc: /* SKIP: real doc in xfns.c. */)
1845 (Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed) 1845 (Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed)
1846{ 1846{
1847 struct haiku_display_info *dpy_info; 1847 struct haiku_display_info *dpyinfo;
1848 CHECK_STRING (display); 1848 CHECK_STRING (display);
1849 1849
1850 if (NILP (Fstring_equal (display, build_string ("be")))) 1850 if (NILP (Fstring_equal (display, build_string ("be"))))
1851 !NILP (must_succeed) ? fatal ("Bad display") : error ("Bad display"); 1851 {
1852 dpy_info = haiku_term_init (); 1852 if (!NILP (must_succeed))
1853 fatal ("Bad display");
1854 else
1855 error ("Bad display");
1856 }
1857
1858 if (x_display_list)
1859 return Qnil;
1860
1861 dpyinfo = haiku_term_init ();
1853 1862
1854 if (!dpy_info) 1863 if (!dpyinfo)
1855 !NILP (must_succeed) ? fatal ("Display not responding") : 1864 {
1856 error ("Display not responding"); 1865 if (!NILP (must_succeed))
1866 fatal ("Display not responding");
1867 else
1868 error ("Display not responding");
1869 }
1857 1870
1858 return Qnil; 1871 return Qnil;
1859} 1872}