… | |
… | |
143 | { |
143 | { |
144 | } |
144 | } |
145 | |
145 | |
146 | bool rxvt_display::init () |
146 | bool rxvt_display::init () |
147 | { |
147 | { |
|
|
148 | #ifdef LOCAL_X_IS_UNIX |
|
|
149 | if (id[0] == ':') |
|
|
150 | { |
|
|
151 | val = rxvt_malloc (5 + strlen (id) + 1); |
|
|
152 | strcpy (val, "unix/"); |
|
|
153 | strcat (val, id); |
|
|
154 | display = XOpenDisplay (val); |
|
|
155 | free (val); |
|
|
156 | } |
|
|
157 | else |
|
|
158 | display = 0; |
|
|
159 | #endif |
|
|
160 | |
|
|
161 | if (!display) |
148 | display = XOpenDisplay (id); |
162 | display = XOpenDisplay (id); |
149 | |
163 | |
150 | if (!display) |
164 | if (!display) |
151 | return false; |
165 | return false; |
152 | |
166 | |
153 | screen = DefaultScreen (display); |
167 | screen = DefaultScreen (display); |
… | |
… | |
231 | (*i)->call (); |
245 | (*i)->call (); |
232 | } |
246 | } |
233 | |
247 | |
234 | void rxvt_display::im_change_check () |
248 | void rxvt_display::im_change_check () |
235 | { |
249 | { |
236 | // make sure we only call im_change_cb when a new input method |
250 | // try to only call im_change_cb when a new input method |
237 | // registers, as xlib crashes due to a race otherwise. |
251 | // registers, as xlib crashes due to a race otherwise. |
238 | Atom actual_type, *atoms; |
252 | Atom actual_type, *atoms; |
239 | int actual_format; |
253 | int actual_format; |
240 | unsigned long nitems, bytes_after; |
254 | unsigned long nitems, bytes_after; |
241 | |
255 | |