X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/0f98bc23509b4e909cc92237e4b082c6866da258..e581a4668750ed98d77f13500c983439770ec600:/src/xselect.c diff --git a/src/xselect.c b/src/xselect.c index b4d61f7c9a..637b39272b 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -308,13 +308,20 @@ x_own_selection (selection_name, selection_value) Lisp_Object selection_name, selection_value; { struct frame *sf = SELECTED_FRAME (); - Window selecting_window = FRAME_X_WINDOW (sf); - Display *display = FRAME_X_DISPLAY (sf); + Window selecting_window; + Display *display; Time time = last_event_timestamp; Atom selection_atom; - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf); + struct x_display_info *dpyinfo; int count; + if (! FRAME_X_P (sf)) + return; + + selecting_window = FRAME_X_WINDOW (sf); + display = FRAME_X_DISPLAY (sf); + dpyinfo = FRAME_X_DISPLAY_INFO (sf); + CHECK_SYMBOL (selection_name); selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name); @@ -578,7 +585,8 @@ some_frame_on_display (dpyinfo) FOR_EACH_FRAME (list, frame) { - if (FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) + if (FRAME_X_P (XFRAME (frame)) + && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) return frame; } @@ -1225,17 +1233,26 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) Lisp_Object selection_symbol, target_type, time_stamp; { struct frame *sf = SELECTED_FRAME (); - Window requestor_window = FRAME_X_WINDOW (sf); - Display *display = FRAME_X_DISPLAY (sf); - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf); + Window requestor_window; + Display *display; + struct x_display_info *dpyinfo; Time requestor_time = last_event_timestamp; - Atom target_property = dpyinfo->Xatom_EMACS_TMP; - Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); + Atom target_property; + Atom selection_atom; Atom type_atom; int secs, usecs; int count; Lisp_Object frame; + if (! FRAME_X_P (sf)) + return Qnil; + + requestor_window = FRAME_X_WINDOW (sf); + display = FRAME_X_DISPLAY (sf); + dpyinfo = FRAME_X_DISPLAY_INFO (sf); + target_property = dpyinfo->Xatom_EMACS_TMP; + selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); + if (CONSP (target_type)) type_atom = symbol_to_x_atom (dpyinfo, display, XCAR (target_type)); else @@ -2009,6 +2026,9 @@ Disowning it means there is no such selection. */) struct frame *sf = SELECTED_FRAME (); check_x (); + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); dpyinfo = FRAME_X_DISPLAY_INFO (sf); CHECK_SYMBOL (selection); @@ -2172,6 +2192,10 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, struct frame *sf = SELECTED_FRAME (); check_x (); + + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); dpyinfo = FRAME_X_DISPLAY_INFO (sf); window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ @@ -2213,6 +2237,10 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, struct frame *sf = SELECTED_FRAME (); check_x (); + + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ @@ -2269,8 +2297,12 @@ Positive means shift the values forward, negative means backward. */) Atom props[8]; Display *display; struct frame *sf = SELECTED_FRAME (); - + check_x (); + + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ CHECK_NUMBER (n);