gtk/gdk/x11/gdkproperty-x11.c

218 lines
5.6 KiB
C
Raw Normal View History

1997-11-24 22:37:52 +00:00
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
1997-11-24 22:37:52 +00:00
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
1997-11-24 22:37:52 +00:00
*
* You should have received a copy of the GNU Lesser General Public
2012-02-27 13:01:10 +00:00
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
1997-11-24 22:37:52 +00:00
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
#include "gdkinternals.h"
#include "gdkprivate-x11.h"
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
#include "gdkdisplay-x11.h"
#include "gdkscreen-x11.h"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
static void
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
insert_atom_pair (GdkDisplay *display,
const char *string,
Atom xatom)
1997-11-24 22:37:52 +00:00
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
char *s;
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
if (!display_x11->atom_from_string)
{
display_x11->atom_from_string = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
display_x11->atom_to_string = g_hash_table_new (NULL, NULL);
}
Added a modular client-message-filter mechanism, that is used for the DND Sun Oct 18 18:16:39 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdk.c gdkprivate.h: Added a modular client-message-filter mechanism, that is used for the DND messages. Removed all the old DND code. * gdk/gdkcolormap.c gdk/gdkcolormap.h: Add a function to get the visual of a given colormap. * gtk/gtkcolorsel.c: Conversion to new DND, drag a color-swatch. * gdk/gdk.h gdk/gdkdnd.c: The low-level X oriented portions of drag and drop protocols. Sending and receiving client messages, and navigating window trees. * gdk/gdkimage.c: added a gdk_flush() when destroying SHM images to hopefully make it more likely that X will gracefully handle the segment being destroyed. * gdk/gdkprivate.h gtk/gtkdebug.h: Add new DND debugging flags. * gtk/gtkeditable.[ch]: Updates for the selection handling changes. * gtk/gtkselection.[ch]: Added GtkTargetList, a refcounted data structure for keeping track of lists of GdkAtom + information. Removed selection_handler_add in favor of a "drag_data_get" signal. * gtk/gtkdnd.[ch] gtk/gtk.h: New files - highlevel (event loop dependent) parts of the DND protocols, display of drag icons, drag-under highlighting, and the "default handlers". * gtk/gtkinvisible.[ch]: New widget - InputOnly offscreen windows that are used for reliable pointer grabs and selection handling in the DND code. * gtk/testdnd.c: New test program for new DND. (Old DND tests in testgtk still need to be converted.) * gtk/testselection.c: Use the new selection API. * docs/dnd_internals: Start at describing how all the new code works inside. * docs/Changes-1.2.txt: New file describing source-incompatible changes in GTK+-1.2. Sat Oct 17 22:50:34 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkwindow.c (gdk_window_remove_filter): Free the right list node. * gdk/gdkwindow.c (gdk_window_init): Add gdk_root_parent to the XID table so we can receive events on it. Wed Oct 14 12:57:40 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c gdk/gdk.h (gdk_event_get_time): New function to get the timestamp from a generic event. Fri Oct 9 13:16:04 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_add_events): Added function that safely adds additional events to a widget's event mask, even if the widget has previously been realized. (We can do this, but not remove events from the event mask). Fri Oct 2 17:35:35 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Allow type == 0, for AnyPropertyType. Fri Oct 2 10:32:21 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Add client-local hashing. Thu Sep 24 20:33:54 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_event_send_clientmessage_toall): serial isn't a timestamp. Thu Sep 17 14:23:03 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_event_translate): Removed printing of unknown window lookup warnings. (Made it a GDK_NOTE) - they happen in many circumstances.
1998-10-18 22:51:24 +00:00
s = g_strdup (string);
g_hash_table_insert (display_x11->atom_from_string, s, GUINT_TO_POINTER (xatom));
g_hash_table_insert (display_x11->atom_to_string, GUINT_TO_POINTER (xatom), s);
}
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
static Atom
lookup_cached_xatom (GdkDisplay *display,
const char *string)
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
if (display_x11->atom_from_string)
return GPOINTER_TO_UINT (g_hash_table_lookup (display_x11->atom_from_string, string));
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
return None;
}
/**
* gdk_x11_get_xatom_by_name_for_display:
* @display: (type GdkX11Display): a `GdkDisplay`
* @atom_name: a string
*
* Returns the X atom for a `GdkDisplay` corresponding to @atom_name.
* This function caches the result, so if called repeatedly it is much
* faster than XInternAtom(), which is a round trip to the server each time.
*
* Returns: a X atom for a `GdkDisplay`
**/
Atom
gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display,
2020-07-24 18:40:36 +00:00
const char *atom_name)
{
Atom xatom = None;
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
g_return_val_if_fail (GDK_IS_DISPLAY (display), None);
if (atom_name == NULL)
return None;
Start implementing display/screen closing scheme; keep a flag for whether Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h: Start implementing display/screen closing scheme; keep a flag for whether displays and screens are closed, call g_object_run_dispose(). Remove public gdk_screen_close(). * gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add dispose() methods; move appropriate parts of the finalize there. * gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c: Start of making everything correctly ignore operations when a display has been closed. * gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations): Handle decorations == NULL. * gdk/x11/gdkcolor-x11.c (gdk_colormap_remove): Remove unnecessary hash table creation. * gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c Fix up gdk_device_get_history - handle events, n_events == NULL, etc. * gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle failure better. * gdk/x11/gdkselection-x11.c (gdk_selection_property_get): Handle failure better, handle data == NULL, move docs here, remove an excess round trip by asking for all selection data at once. * gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move gdk_text_property_to_text_list(), gdk_string_to_compound_text(), gdk_display_set_sm_client_id() to display-independent part of GDK. * gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch] into the right place.
2002-08-01 15:28:40 +00:00
if (gdk_display_is_closed (display))
Start implementing display/screen closing scheme; keep a flag for whether Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h: Start implementing display/screen closing scheme; keep a flag for whether displays and screens are closed, call g_object_run_dispose(). Remove public gdk_screen_close(). * gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add dispose() methods; move appropriate parts of the finalize there. * gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c: Start of making everything correctly ignore operations when a display has been closed. * gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations): Handle decorations == NULL. * gdk/x11/gdkcolor-x11.c (gdk_colormap_remove): Remove unnecessary hash table creation. * gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c Fix up gdk_device_get_history - handle events, n_events == NULL, etc. * gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle failure better. * gdk/x11/gdkselection-x11.c (gdk_selection_property_get): Handle failure better, handle data == NULL, move docs here, remove an excess round trip by asking for all selection data at once. * gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move gdk_text_property_to_text_list(), gdk_string_to_compound_text(), gdk_display_set_sm_client_id() to display-independent part of GDK. * gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch] into the right place.
2002-08-01 15:28:40 +00:00
return None;
xatom = lookup_cached_xatom (display, atom_name);
if (!xatom)
{
xatom = XInternAtom (GDK_DISPLAY_XDISPLAY (display), atom_name, FALSE);
insert_atom_pair (display, atom_name, xatom);
}
Added a modular client-message-filter mechanism, that is used for the DND Sun Oct 18 18:16:39 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdk.c gdkprivate.h: Added a modular client-message-filter mechanism, that is used for the DND messages. Removed all the old DND code. * gdk/gdkcolormap.c gdk/gdkcolormap.h: Add a function to get the visual of a given colormap. * gtk/gtkcolorsel.c: Conversion to new DND, drag a color-swatch. * gdk/gdk.h gdk/gdkdnd.c: The low-level X oriented portions of drag and drop protocols. Sending and receiving client messages, and navigating window trees. * gdk/gdkimage.c: added a gdk_flush() when destroying SHM images to hopefully make it more likely that X will gracefully handle the segment being destroyed. * gdk/gdkprivate.h gtk/gtkdebug.h: Add new DND debugging flags. * gtk/gtkeditable.[ch]: Updates for the selection handling changes. * gtk/gtkselection.[ch]: Added GtkTargetList, a refcounted data structure for keeping track of lists of GdkAtom + information. Removed selection_handler_add in favor of a "drag_data_get" signal. * gtk/gtkdnd.[ch] gtk/gtk.h: New files - highlevel (event loop dependent) parts of the DND protocols, display of drag icons, drag-under highlighting, and the "default handlers". * gtk/gtkinvisible.[ch]: New widget - InputOnly offscreen windows that are used for reliable pointer grabs and selection handling in the DND code. * gtk/testdnd.c: New test program for new DND. (Old DND tests in testgtk still need to be converted.) * gtk/testselection.c: Use the new selection API. * docs/dnd_internals: Start at describing how all the new code works inside. * docs/Changes-1.2.txt: New file describing source-incompatible changes in GTK+-1.2. Sat Oct 17 22:50:34 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkwindow.c (gdk_window_remove_filter): Free the right list node. * gdk/gdkwindow.c (gdk_window_init): Add gdk_root_parent to the XID table so we can receive events on it. Wed Oct 14 12:57:40 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c gdk/gdk.h (gdk_event_get_time): New function to get the timestamp from a generic event. Fri Oct 9 13:16:04 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_add_events): Added function that safely adds additional events to a widget's event mask, even if the widget has previously been realized. (We can do this, but not remove events from the event mask). Fri Oct 2 17:35:35 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Allow type == 0, for AnyPropertyType. Fri Oct 2 10:32:21 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Add client-local hashing. Thu Sep 24 20:33:54 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_event_send_clientmessage_toall): serial isn't a timestamp. Thu Sep 17 14:23:03 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_event_translate): Removed printing of unknown window lookup warnings. (Made it a GDK_NOTE) - they happen in many circumstances.
1998-10-18 22:51:24 +00:00
return xatom;
1997-11-24 22:37:52 +00:00
}
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
void
_gdk_x11_precache_atoms (GdkDisplay *display,
2020-07-24 18:40:36 +00:00
const char * const *atom_names,
2020-07-24 13:54:49 +00:00
int n_atoms)
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
{
Atom *xatoms;
const char **xatom_names;
2020-07-24 13:54:49 +00:00
int n_xatoms;
int i;
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
xatoms = g_new (Atom, n_atoms);
xatom_names = g_new (const char *, n_atoms);
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
n_xatoms = 0;
for (i = 0; i < n_atoms; i++)
{
if (lookup_cached_xatom (display, atom_names[i]) == None)
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
{
xatom_names[n_xatoms] = atom_names[i];
n_xatoms++;
}
}
if (n_xatoms)
XInternAtoms (GDK_DISPLAY_XDISPLAY (display),
(char **) xatom_names, n_xatoms, False, xatoms);
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
for (i = 0; i < n_xatoms; i++)
insert_atom_pair (display, xatom_names[i], xatoms[i]);
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
g_free (xatoms);
g_free (xatom_names);
Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap Fri Jul 4 15:57:52 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap errors and XSync(). * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use _gdk_x11_set_input_focus_safe() here as well. * gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Rework handling of property notifies on _NET_WM_STATE so that we ignore _NET_WM_DESKTOP notifies unless we really care. * gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use XShmQueryExtension() rather than XQueryExtension() to avoid extra rountrip. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Remove unused call to XGetWindowAttributes() * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove unused call to XGetKeyboardControl(). * gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush): Add (#99571) * gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c No-op implementations of gdk_display_flush(). * gdk/gdkwindow.c (gdk_window_process_all_updates): Use gdk_display_flush() rather than gdk_flush() to avoid XSync(). * gdk/x11/gdkwindow-x11.c (update_wm_hints) gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here so that we don't have to get the property back from the server. * gdk/x11/gdkwindow-x11.c (show_window_internal): Store the serial of when we map a toplevel to allow optimizing out notifies on _NET_WM_STATE/_NET_WM_DESKTOP. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't XTranslateCoordinates() for override-redirect windows. Fri Jul 4 15:59:27 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment about setting window group after the window is mapped from docs - nothing the ICCCM forbids that. * gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size): Fix g_return_val_if_fail() in void return function. * configure.in: Fix misplaced comma that was resulting in XShm always being disabled.
2003-07-05 01:54:05 +00:00
}
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
/**
* gdk_x11_get_xatom_name_for_display:
* @display: (type GdkX11Display): the `GdkDisplay` where @xatom is defined
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
* @xatom: an X atom
*
* Returns the name of an X atom for its display. This
* function is meant mainly for debugging, so for convenience, unlike
* XAtomName() and the result doesnt need to
* be freed.
*
* Returns: name of the X atom; this string is owned by GDK,
2020-06-18 07:47:16 +00:00
* so it shouldnt be modified or freed.
**/
2020-07-24 18:40:36 +00:00
const char *
gdk_x11_get_xatom_name_for_display (GdkDisplay *display,
Atom xatom)
1997-11-24 22:37:52 +00:00
{
GdkX11Display *display_x11;
const char *string;
2017-11-15 17:13:31 +00:00
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
if (xatom == None)
2017-11-15 17:13:31 +00:00
return NULL;
Start implementing display/screen closing scheme; keep a flag for whether Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h: Start implementing display/screen closing scheme; keep a flag for whether displays and screens are closed, call g_object_run_dispose(). Remove public gdk_screen_close(). * gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add dispose() methods; move appropriate parts of the finalize there. * gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c: Start of making everything correctly ignore operations when a display has been closed. * gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations): Handle decorations == NULL. * gdk/x11/gdkcolor-x11.c (gdk_colormap_remove): Remove unnecessary hash table creation. * gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c Fix up gdk_device_get_history - handle events, n_events == NULL, etc. * gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle failure better. * gdk/x11/gdkselection-x11.c (gdk_selection_property_get): Handle failure better, handle data == NULL, move docs here, remove an excess round trip by asking for all selection data at once. * gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move gdk_text_property_to_text_list(), gdk_string_to_compound_text(), gdk_display_set_sm_client_id() to display-independent part of GDK. * gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch] into the right place.
2002-08-01 15:28:40 +00:00
if (gdk_display_is_closed (display))
2017-11-15 17:13:31 +00:00
return NULL;
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
display_x11 = GDK_X11_DISPLAY (display);
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
if (display_x11->atom_to_string)
string = g_hash_table_lookup (display_x11->atom_to_string,
GUINT_TO_POINTER (xatom));
else
string = NULL;
if (!string)
{
/* If this atom doesn't exist, we'll die with an X error unless
* we take precautions
*/
char *name;
gdk_x11_display_error_trap_push (display);
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
name = XGetAtomName (GDK_DISPLAY_XDISPLAY (display), xatom);
if (gdk_x11_display_error_trap_pop (display))
{
g_warning (G_STRLOC " invalid X atom: %ld", xatom);
}
else
{
insert_atom_pair (display, name, xatom);
XFree (name);
string = g_hash_table_lookup (display_x11->atom_to_string,
GUINT_TO_POINTER (xatom));
}
}
1997-11-24 22:37:52 +00:00
return string;
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
}
Atom
_gdk_x11_get_xatom_for_display_printf (GdkDisplay *display,
2020-07-24 18:40:36 +00:00
const char *format,
...)
{
va_list args;
char *atom_name;
Atom atom;
va_start (args, format);
atom_name = g_strdup_vprintf (format, args);
va_end (args);
atom = gdk_x11_get_xatom_by_name_for_display (display, atom_name);
g_free (atom_name);
return atom;
}