Commit 2d9074ba authored by Jan Djärv's avatar Jan Djärv

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.
parent c869cc37
2010-11-11 Julien Danjou <julien@danjou.info>
* 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.
2010-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
......
......@@ -3600,7 +3600,6 @@ extern void syms_of_xfns (void);
extern void syms_of_xsmfns (void);
/* Defined in xselect.c */
EXFUN (Fx_send_client_event, 6);
extern void syms_of_xselect (void);
/* Defined in xterm.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;
}
......
......@@ -656,18 +656,10 @@ init_gconf (void)
static void
init_xsettings (struct x_display_info *dpyinfo)
{
char sel[64];
Display *dpy = dpyinfo->display;
BLOCK_INPUT;
sprintf (sel, "_XSETTINGS_S%d", XScreenNumberOfScreen (dpyinfo->screen));
dpyinfo->Xatom_xsettings_sel = XInternAtom (dpy, sel, False);
dpyinfo->Xatom_xsettings_prop = XInternAtom (dpy,
"_XSETTINGS_SETTINGS",
False);
dpyinfo->Xatom_xsettings_mgr = XInternAtom (dpy, "MANAGER", False);
/* Select events so we can detect client messages sent when selection
owner changes. */
XSelectInput (dpy, dpyinfo->root_window, StructureNotifyMask);
......
......@@ -410,8 +410,8 @@ create_client_leader_window (struct x_display_info *dpyinfo, char *client_id)
XSetClassHint (dpyinfo->display, w, &class_hints);
XStoreName (dpyinfo->display, w, class_hints.res_name);
sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False);
XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace,
XChangeProperty (dpyinfo->display, w, dpyinfo->Xatom_SM_CLIENT_ID,
XA_STRING, 8, PropModeReplace,
(unsigned char *)client_id, strlen (client_id));
dpyinfo->client_leader_window = w;
......
This diff is collapsed.
......@@ -270,7 +270,7 @@ struct x_display_info
Atom Xatom_Scrollbar;
/* Atom used in XEmbed client messages. */
Atom Xatom_XEMBED;
Atom Xatom_XEMBED, Xatom_XEMBED_INFO;;
/* The frame (if any) which has the X window that has keyboard focus.
Zero if none. This is examined by Ffocus_frame in xfns.c. Note
......@@ -332,13 +332,15 @@ struct x_display_info
/* Extended window manager hints, Atoms supported by the window manager and
atoms for settig the window type. */
Atom Xatom_net_supported, Xatom_net_supporting_wm_check;
Atom *net_supported_atoms;
int nr_net_supported_atoms;
Window net_supported_window;
Atom Xatom_net_window_type, Xatom_net_window_type_tooltip;
Atom Xatom_net_active_window;
/* Atoms dealing with EWMH (i.e. _NET_...) */
Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom,
Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen,
Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert,
Xatom_net_wm_state_sticky, Xatom_net_frame_extents;
......@@ -348,6 +350,11 @@ struct x_display_info
/* Frame name and icon name */
Atom Xatom_net_wm_name, Xatom_net_wm_icon_name;
/* Frame opacity */
Atom Xatom_net_wm_window_opacity;
/* SM */
Atom Xatom_SM_CLIENT_ID;
};
#ifdef HAVE_X_I18N
......@@ -1011,6 +1018,13 @@ extern void x_handle_selection_notify (XSelectionEvent *);
extern void x_handle_selection_event (struct input_event *);
extern void x_clear_frame_selections (struct frame *);
extern void x_send_client_event (Lisp_Object display,
Lisp_Object dest,
Lisp_Object from,
Atom message_type,
Lisp_Object format,
Lisp_Object values);
extern int x_handle_dnd_message (struct frame *,
XClientMessageEvent *,
struct x_display_info *,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment