From 2d9074ba9a5abaa7956e905a02ea180984f0540f Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 12 Nov 2010 10:31:44 +0100 Subject: Apply XAtom revork patches from Julien Danjou. * xsettings.c (init_xsettings): Use already fetch atoms. * xsmfns.c (create_client_leader_window): Use SM_CLIENT_ID atom from dpyinfo. * xselect.c (Fx_send_client_event): Split and create x_send_client_event. * lisp.h: Do not EXFUN Fx_send_client_event. * xterm.c (x_set_frame_alpha): Use _NET_WM_WINDOW_OPACITY atom from dpyinfo. (wm_supports): Use atoms from dpyinfo. (do_ewmh_fullscreen): Use atoms from dpyinfo. (x_ewmh_activate_frame): Use atoms from dpyinfo. (xembed_set_info): Use atoms from dpyinfo. (x_term_init): Fetch _XEMBED_INFO, _NET_SUPPORTED, _NET_SUPPORTING_WM_CHECK, _NET_WM_WINDOW_OPACITY and _NET_ACTIVE_WINDOW, XSETTINGS atoms. Get all atoms in one round-trip. (set_wm_state): Use x_send_client_event rather than Fx_send_client_event, using Atom directly. (x_ewmh_activate_frame): Ditto. (x_set_sticky): Pass atoms to set_wm_state. (do_ewmh_fullscreen): Ditto. * xterm.h (x_display_info): Add Xatom_net_supported, Xatom_net_supporting_wm_check, Xatom_net_active_window, Xatom_net_wm_window_opacity, Xatom_XEMBED_INFO, SM_CLIENT_ID. * xfns.c (Fx_show_tip): Fix typo in docstring. --- src/xselect.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/xselect.c') diff --git a/src/xselect.c b/src/xselect.c index 7479f245a77..b566b90898f 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2525,6 +2525,18 @@ with the high 16 bits from the car and the lower 16 bit from the cdr. If more values than fits into the event is given, the excessive values are ignored. */) (Lisp_Object display, Lisp_Object dest, Lisp_Object from, Lisp_Object message_type, Lisp_Object format, Lisp_Object values) +{ + struct x_display_info *dpyinfo = check_x_display_info (display); + + x_send_client_event(display, dest, from, + XInternAtom (dpyinfo->display, SDATA (message_type), False), + format, values); + + return Qnil; +} + +void +x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from, Atom message_type, Lisp_Object format, Lisp_Object values) { struct x_display_info *dpyinfo = check_x_display_info (display); Window wdest; @@ -2584,8 +2596,7 @@ are ignored. */) BLOCK_INPUT; - event.xclient.message_type - = XInternAtom (dpyinfo->display, SDATA (message_type), False); + event.xclient.message_type = message_type; event.xclient.display = dpyinfo->display; /* Some clients (metacity for example) expects sending window to be here @@ -2610,8 +2621,6 @@ are ignored. */) } x_uncatch_errors (); UNBLOCK_INPUT; - - return Qnil; } -- cgit v1.2.1 From 933e29ff5e9d63ae6976cc998980042fbea09b26 Mon Sep 17 00:00:00 2001 From: Jan D Date: Sat, 13 Nov 2010 19:59:28 +0100 Subject: Fix Atoms and Lisp_Object mixup and related bugs. * src/xselect.c (x_send_client_event): Move CHECK_STRING ... (Fx_send_client_event): to here. * src/xterm.c (set_wm_state): Don't put Atom in cons, call make_fixnum_or_float on them first. (x_term_init): Initialize Xatom_net_supporting_wm_check and Xatom_net_supported correctly. --- src/xselect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/xselect.c') diff --git a/src/xselect.c b/src/xselect.c index b566b90898f..ea64d9c3f36 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2528,8 +2528,11 @@ are ignored. */) { struct x_display_info *dpyinfo = check_x_display_info (display); + CHECK_STRING (message_type); x_send_client_event(display, dest, from, - XInternAtom (dpyinfo->display, SDATA (message_type), False), + XInternAtom (dpyinfo->display, + SDATA (message_type), + False), format, values); return Qnil; @@ -2546,7 +2549,6 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from, At struct frame *f = check_x_frame (from); int to_root; - CHECK_STRING (message_type); CHECK_NUMBER (format); CHECK_CONS (values); -- cgit v1.2.1 From 5a232ffb73021c9c00dcfd959da43b6425f67cd7 Mon Sep 17 00:00:00 2001 From: Jan D Date: Sun, 14 Nov 2010 11:21:16 +0100 Subject: Fix last cons in set_wm_state, remove unused variables. * src/xselect.c (x_send_client_event): Remove unused variables cons and size. * src/xterm.c (set_wm_state): Add Qnil to final cons. --- src/xselect.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/xselect.c') diff --git a/src/xselect.c b/src/xselect.c index ea64d9c3f36..7b91d6f69b9 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2544,8 +2544,6 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from, At struct x_display_info *dpyinfo = check_x_display_info (display); Window wdest; XEvent event; - Lisp_Object cons; - int size; struct frame *f = check_x_frame (from); int to_root; @@ -2593,9 +2591,6 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from, At if (wdest == 0) wdest = dpyinfo->root_window; to_root = wdest == dpyinfo->root_window; - for (cons = values, size = 0; CONSP (cons); cons = XCDR (cons), ++size) - ; - BLOCK_INPUT; event.xclient.message_type = message_type; -- cgit v1.2.1