gtk2/gdk/x11/gdkwindow-x11.c

5820 lines
168 KiB
C
Raw Normal View History

1997-11-24 22:37:52 +00:00
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-2007 Peter Mattis, Spencer Kimball,
* Josh MacDonald, Ryan Lortie
1997-11-24 22:37:52 +00:00
*
* 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"
#include "gdkwindow-x11.h"
#include "gdkwindow.h"
#include "gdkwindowimpl.h"
#include "gdkvisualprivate.h"
2000-03-28 01:24:44 +00:00
#include "gdkinternals.h"
2010-05-25 22:38:44 +00:00
#include "gdkdeviceprivate.h"
#include "gdkframeclockprivate.h"
#include "gdkasync.h"
2010-05-25 22:38:44 +00:00
#include "gdkeventsource.h"
#include "gdkdisplay-x11.h"
#include "gdkprivate-x11.h"
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <unistd.h>
#include <cairo-xlib.h>
#include "MwmUtil.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
1997-11-24 22:37:52 +00:00
configure.in acheader.h gdk/gdkwindow.c Check for Shape extension both on Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org> * configure.in acheader.h gdk/gdkwindow.c Check for Shape extension both on the client and server side. (And, more importantly, check for the shape extension so we may include -lXext even when compiling with --disable-xshm) Don't set override_redirect on all shaped windows. It isn't necessary. * gdk/gdkwindow.c: Set ->colormap to NULL for root and foreign windows. Use this to check if we need to get the colormap from X. Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtkbutton.c (gtk_button_paint): Draw the areas between the default and the button always in GTK_STATE_NORMAL. * gtk/gtkrange.c (gtk_range_style_set): Added a style_set callback. Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]): Fix a buffer overflow on pixmaps that claim to have more than 31 characters per pixel. (gdk_pixmap_read_string): Don't wrap around strings longer than half of address space ;-) * gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers that were used for printing integers. * */* (almost): Style: All int foo () { ... } changed to int foo (void) { ... } ^^^^^^^ This is why some many files changed Even where there were proper prototypes elsewhere. * gdk/gxid.c (handle_claim_device): Some extra checks. It isn't safe against being fed bad X id's, but at least it should be safe against deleting all your files.
1998-05-03 22:41:32 +00:00
#include <X11/extensions/shape.h>
#ifdef HAVE_XKB
#include <X11/XKBlib.h>
#endif
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
#endif
#ifdef HAVE_XFIXES
#include <X11/extensions/Xfixes.h>
#endif
#ifdef HAVE_XDAMAGE
#include <X11/extensions/Xdamage.h>
#endif
const int _gdk_x11_event_mask_table[21] =
1997-11-24 22:37:52 +00:00
{
ExposureMask,
PointerMotionMask,
PointerMotionHintMask,
ButtonMotionMask,
Button1MotionMask,
Button2MotionMask,
Button3MotionMask,
ButtonPressMask,
ButtonReleaseMask,
1997-11-24 22:37:52 +00:00
KeyPressMask,
KeyReleaseMask,
EnterWindowMask,
LeaveWindowMask,
FocusChangeMask,
StructureNotifyMask,
PropertyChangeMask,
VisibilityChangeMask,
0, /* PROXIMITY_IN */
0, /* PROXIMTY_OUT */
SubstructureNotifyMask,
ButtonPressMask /* SCROLL; on X mouse wheel events is treated as mouse button 4/5 */
1997-11-24 22:37:52 +00:00
};
const gint _gdk_x11_event_mask_table_size = G_N_ELEMENTS (_gdk_x11_event_mask_table);
1997-11-24 22:37:52 +00:00
/* Forward declarations */
static void gdk_x11_window_apply_fullscreen_mode (GdkWindow *window);
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
static void gdk_window_set_static_win_gravity (GdkWindow *window,
gboolean on);
static gboolean gdk_window_icon_name_set (GdkWindow *window);
static void set_wm_name (GdkDisplay *display,
Window xwindow,
const gchar *name);
static void move_to_current_desktop (GdkWindow *window);
static void gdk_window_x11_set_background (GdkWindow *window,
cairo_pattern_t *pattern);
1997-11-24 22:37:52 +00:00
static void gdk_window_impl_x11_finalize (GObject *object);
2000-03-28 01:24:44 +00:00
#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
(GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL || \
GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || \
GDK_WINDOW_TYPE (window) == GDK_WINDOW_FOREIGN)
#define WINDOW_IS_TOPLEVEL(window) \
(GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL || \
GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
/* Return whether time1 is considered later than time2 as far as xserver
* time is concerned. Accounts for wraparound.
*/
#define XSERVER_TIME_IS_LATER(time1, time2) \
( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) || \
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
)
struct _GdkX11Window {
GdkWindow parent;
};
struct _GdkX11WindowClass {
GdkWindowClass parent_class;
};
G_DEFINE_TYPE (GdkX11Window, gdk_x11_window, GDK_TYPE_WINDOW)
static void
gdk_x11_window_class_init (GdkX11WindowClass *x11_window_class)
{
}
static void
gdk_x11_window_init (GdkX11Window *x11_window)
{
}
G_DEFINE_TYPE (GdkWindowImplX11, gdk_window_impl_x11, GDK_TYPE_WINDOW_IMPL)
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
static void
gdk_window_impl_x11_init (GdkWindowImplX11 *impl)
{
impl->device_cursor = g_hash_table_new_full (NULL, NULL,
NULL, g_object_unref);
impl->window_scale = 1;
impl->frame_sync_enabled = TRUE;
}
GdkToplevelX11 *
_gdk_x11_window_get_toplevel (GdkWindow *window)
{
GdkWindowImplX11 *impl;
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
if (!WINDOW_IS_TOPLEVEL (window))
return NULL;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!impl->toplevel)
{
impl->toplevel = g_new0 (GdkToplevelX11, 1);
impl->toplevel->have_focused = TRUE;
}
return impl->toplevel;
}
static const cairo_user_data_key_t gdk_x11_cairo_key;
/**
* _gdk_x11_window_update_size:
* @impl: a #GdkWindowImplX11.
*
* Updates the state of the window (in particular the drawable's
* cairo surface) when its size has changed.
**/
void
_gdk_x11_window_update_size (GdkWindowImplX11 *impl)
{
if (impl->cairo_surface)
{
cairo_xlib_surface_set_size (impl->cairo_surface,
gdk_window_get_width (impl->wrapper) * impl->window_scale,
gdk_window_get_height (impl->wrapper) * impl->window_scale);
}
}
static void
set_sync_counter(Display *display,
XSyncCounter counter,
gint64 value)
{
XSyncValue sync_value;
XSyncIntsToValue(&sync_value,
value & G_GINT64_CONSTANT(0xFFFFFFFF),
value >> 32);
XSyncSetCounter(display, counter, sync_value);
}
static void
window_pre_damage (GdkWindow *window)
{
GdkWindow *toplevel_window = gdk_window_get_toplevel (window);
GdkWindowImplX11 *impl;
if (!toplevel_window || !WINDOW_IS_TOPLEVEL (toplevel_window))
return;
impl = GDK_WINDOW_IMPL_X11 (toplevel_window->impl);
if (impl->toplevel->in_frame &&
impl->toplevel->current_counter_value % 2 == 0)
{
impl->toplevel->current_counter_value += 1;
set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
impl->toplevel->extended_update_counter,
impl->toplevel->current_counter_value);
}
}
static void
on_surface_changed (void *data)
{
GdkWindow *window = data;
window_pre_damage (window);
}
/* We want to know when cairo drawing causes damage to the window,
* so we engage in the _NET_WM_FRAME_DRAWN protocol with the
* window only when there actually is drawing. To do that we use
* a technique (hack) suggested by Uli Schlachter - if we set
* a dummy "mime data" on the cairo surface (this facility is
* used to attach JPEG data to an imager), then cairo wil flush
* and remove the mime data before making any changes to the window.
*/
static void
hook_surface_changed (GdkWindow *window)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (impl->cairo_surface)
cairo_surface_set_mime_data (impl->cairo_surface,
"x-gdk/change-notify",
(unsigned char *)"X",
1,
on_surface_changed,
window);
}
static void
unhook_surface_changed (GdkWindow *window)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (impl->cairo_surface)
cairo_surface_set_mime_data (impl->cairo_surface,
"x-gdk/change-notify",
NULL, 0,
NULL, NULL);
}
static void
gdk_x11_window_predict_presentation_time (GdkWindow *window)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkFrameClock *clock;
GdkFrameTimings *timings;
gint64 presentation_time;
gint64 refresh_interval;
if (!WINDOW_IS_TOPLEVEL (window))
return;
clock = gdk_window_get_frame_clock (window);
timings = gdk_frame_clock_get_current_timings (clock);
gdk_frame_clock_get_refresh_info (clock,
timings->frame_time,
&refresh_interval, &presentation_time);
if (presentation_time != 0)
{
if (timings->slept_before)
{
presentation_time += refresh_interval;
}
else
{
if (presentation_time < timings->frame_time + refresh_interval / 2)
presentation_time += refresh_interval;
}
}
else
{
if (timings->slept_before)
presentation_time = timings->frame_time + refresh_interval + refresh_interval / 2;
else
presentation_time = timings->frame_time + refresh_interval;
}
if (presentation_time < impl->toplevel->throttled_presentation_time)
presentation_time = impl->toplevel->throttled_presentation_time;
timings->predicted_presentation_time = presentation_time;
}
static void
gdk_x11_window_begin_frame (GdkWindow *window,
gboolean force_frame)
{
GdkWindowImplX11 *impl;
g_return_if_fail (GDK_IS_WINDOW (window));
impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!WINDOW_IS_TOPLEVEL (window) ||
impl->toplevel->extended_update_counter == None)
return;
impl->toplevel->in_frame = TRUE;
if (impl->toplevel->configure_counter_value != 0 &&
impl->toplevel->configure_counter_value_is_extended)
{
impl->toplevel->current_counter_value = impl->toplevel->configure_counter_value;
if ((impl->toplevel->current_counter_value % 2) == 1)
impl->toplevel->current_counter_value += 1;
impl->toplevel->configure_counter_value = 0;
window_pre_damage (window);
}
else if (force_frame)
{
/* When mapping the window, we really want to freeze the
rendering of the window by the compositor until we've
actually painted something into the window's buffer. */
window_pre_damage (window);
}
else
{
hook_surface_changed (window);
}
}
static void
gdk_x11_window_end_frame (GdkWindow *window)
{
GdkFrameClock *clock;
GdkFrameTimings *timings;
GdkWindowImplX11 *impl;
g_return_if_fail (GDK_IS_WINDOW (window));
impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!WINDOW_IS_TOPLEVEL (window) ||
impl->toplevel->extended_update_counter == None ||
!impl->toplevel->in_frame)
return;
clock = gdk_window_get_frame_clock (window);
timings = gdk_frame_clock_get_current_timings (clock);
impl->toplevel->in_frame = FALSE;
if (impl->toplevel->current_counter_value % 2 == 1)
{
#ifdef G_ENABLE_DEBUG
if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
{
XImage *image = XGetImage (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
0, 0, 1, 1,
(1 << 24) - 1,
ZPixmap);
XDestroyImage (image);
}
#endif /* G_ENABLE_DEBUG */
/* An increment of 3 means that the frame was not drawn as fast as possible,
* but rather at a particular time. This can trigger different handling from
* the compositor.
*/
if (timings->slept_before)
impl->toplevel->current_counter_value += 3;
else
impl->toplevel->current_counter_value += 1;
set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
impl->toplevel->extended_update_counter,
impl->toplevel->current_counter_value);
if (impl->frame_sync_enabled &&
gdk_x11_screen_supports_net_wm_hint (gdk_window_get_screen (window),
gdk_atom_intern_static_string ("_NET_WM_FRAME_DRAWN")))
{
impl->toplevel->frame_pending = TRUE;
_gdk_frame_clock_freeze (gdk_window_get_frame_clock (window));
timings->cookie = impl->toplevel->current_counter_value;
}
}
unhook_surface_changed (window);
if (impl->toplevel->configure_counter_value != 0 &&
!impl->toplevel->configure_counter_value_is_extended)
{
set_sync_counter (GDK_WINDOW_XDISPLAY (window),
impl->toplevel->update_counter,
impl->toplevel->configure_counter_value);
impl->toplevel->configure_counter_value = 0;
}
if (!impl->toplevel->frame_pending)
timings->complete = TRUE;
}
/*****************************************************
* X11 specific implementations of generic functions *
*****************************************************/
static void
gdk_x11_cairo_surface_destroy (void *data)
{
GdkWindowImplX11 *impl = data;
impl->cairo_surface = NULL;
}
static cairo_surface_t *
gdk_x11_create_cairo_surface (GdkWindowImplX11 *impl,
int width,
int height)
{
GdkVisual *visual;
visual = gdk_window_get_visual (impl->wrapper);
return cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (impl->wrapper),
GDK_WINDOW_IMPL_X11 (impl)->xid,
GDK_VISUAL_XVISUAL (visual),
width, height);
}
static cairo_surface_t *
gdk_x11_ref_cairo_surface (GdkWindow *window)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (GDK_WINDOW_DESTROYED (window))
return NULL;
if (!impl->cairo_surface)
{
impl->cairo_surface = gdk_x11_create_cairo_surface (impl,
gdk_window_get_width (window) * impl->window_scale,
gdk_window_get_height (window) * impl->window_scale);
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale);
#endif
if (impl->cairo_surface)
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
impl, gdk_x11_cairo_surface_destroy);
if (WINDOW_IS_TOPLEVEL (window) && impl->toplevel->in_frame)
hook_surface_changed (window);
}
else
cairo_surface_reference (impl->cairo_surface);
return impl->cairo_surface;
}
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
static void
gdk_window_impl_x11_finalize (GObject *object)
{
GdkWindow *wrapper;
GdkWindowImplX11 *impl;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (object));
impl = GDK_WINDOW_IMPL_X11 (object);
wrapper = impl->wrapper;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (WINDOW_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame)
unhook_surface_changed (wrapper);
_gdk_x11_window_grab_check_destroy (wrapper);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (!GDK_WINDOW_DESTROYED (wrapper))
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (wrapper);
2010-12-16 04:35:15 +00:00
_gdk_x11_display_remove_window (display, impl->xid);
if (impl->toplevel && impl->toplevel->focus_window)
2010-12-16 04:35:15 +00:00
_gdk_x11_display_remove_window (display, impl->toplevel->focus_window);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
}
g_free (impl->toplevel);
if (impl->cursor)
g_object_unref (impl->cursor);
g_hash_table_destroy (impl->device_cursor);
2010-05-25 22:38:44 +00:00
G_OBJECT_CLASS (gdk_window_impl_x11_parent_class)->finalize (object);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
}
2000-03-28 01:24:44 +00:00
typedef struct {
GdkDisplay *display;
Pixmap pixmap;
} FreePixmapData;
static void
free_pixmap (gpointer datap)
{
FreePixmapData *data = datap;
if (!gdk_display_is_closed (data->display))
{
XFreePixmap (GDK_DISPLAY_XDISPLAY (data->display),
data->pixmap);
}
g_object_unref (data->display);
g_slice_free (FreePixmapData, data);
}
static void
attach_free_pixmap_handler (cairo_surface_t *surface,
GdkDisplay *display,
Pixmap pixmap)
{
static const cairo_user_data_key_t key;
FreePixmapData *data;
data = g_slice_new (FreePixmapData);
data->display = g_object_ref (display);
data->pixmap = pixmap;
cairo_surface_set_user_data (surface, &key, data, free_pixmap);
}
/* Cairo does not guarantee we get an xlib surface if we call
* cairo_surface_create_similar(). In some cases however, we must use a
* pixmap or bitmap in the X11 API.
* These functions ensure an Xlib surface.
*/
cairo_surface_t *
_gdk_x11_window_create_bitmap_surface (GdkWindow *window,
int width,
int height)
{
cairo_surface_t *surface;
Pixmap pixmap;
pixmap = XCreatePixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
width, height, 1);
surface = cairo_xlib_surface_create_for_bitmap (GDK_WINDOW_XDISPLAY (window),
pixmap,
GDK_X11_SCREEN (GDK_WINDOW_SCREEN (window))->xscreen,
width, height);
attach_free_pixmap_handler (surface, GDK_WINDOW_DISPLAY (window), pixmap);
return surface;
}
/* Create a surface backed with a pixmap without alpha on the same screen as window */
static cairo_surface_t *
gdk_x11_window_create_pixmap_surface (GdkWindow *window,
int width,
int height)
{
GdkScreen *screen = gdk_window_get_screen (window);
GdkVisual *visual = gdk_screen_get_system_visual (screen);
cairo_surface_t *surface;
Pixmap pixmap;
pixmap = XCreatePixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
width, height,
gdk_visual_get_depth (visual));
surface = cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (window),
pixmap,
GDK_VISUAL_XVISUAL (visual),
width, height);
attach_free_pixmap_handler (surface, GDK_WINDOW_DISPLAY (window), pixmap);
return surface;
}
static void
tmp_unset_bg (GdkWindow *window)
{
GdkWindowImplX11 *impl;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
impl->no_bg = TRUE;
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
}
static void
tmp_reset_bg (GdkWindow *window)
{
GdkWindowImplX11 *impl;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
impl->no_bg = FALSE;
gdk_window_x11_set_background (window, window->background);
}
/* Unsetting and resetting window backgrounds.
*
* In many cases it is possible to avoid flicker by unsetting the
* background of windows. For example if the background of the
* parent window is unset when a window is unmapped, a brief flicker
* of background painting is avoided.
*/
void
_gdk_x11_window_tmp_unset_bg (GdkWindow *window,
gboolean recurse)
{
g_return_if_fail (GDK_IS_WINDOW (window));
if (window->input_only || window->destroyed ||
(window->window_type != GDK_WINDOW_ROOT &&
!GDK_WINDOW_IS_MAPPED (window)))
return;
if (_gdk_window_has_impl (window) &&
GDK_WINDOW_IS_X11 (window) &&
window->window_type != GDK_WINDOW_ROOT &&
window->window_type != GDK_WINDOW_FOREIGN)
tmp_unset_bg (window);
if (recurse)
{
GList *l;
for (l = window->children; l != NULL; l = l->next)
_gdk_x11_window_tmp_unset_bg (l->data, TRUE);
}
}
void
_gdk_x11_window_tmp_unset_parent_bg (GdkWindow *window)
{
if (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT)
return;
window = _gdk_window_get_impl_window (window->parent);
_gdk_x11_window_tmp_unset_bg (window, FALSE);
}
void
_gdk_x11_window_tmp_reset_bg (GdkWindow *window,
gboolean recurse)
{
g_return_if_fail (GDK_IS_WINDOW (window));
if (window->input_only || window->destroyed ||
(window->window_type != GDK_WINDOW_ROOT &&
!GDK_WINDOW_IS_MAPPED (window)))
return;
if (_gdk_window_has_impl (window) &&
GDK_WINDOW_IS_X11 (window) &&
window->window_type != GDK_WINDOW_ROOT &&
window->window_type != GDK_WINDOW_FOREIGN)
tmp_reset_bg (window);
if (recurse)
{
GList *l;
for (l = window->children; l != NULL; l = l->next)
_gdk_x11_window_tmp_reset_bg (l->data, TRUE);
}
}
void
_gdk_x11_window_tmp_reset_parent_bg (GdkWindow *window)
{
if (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT)
return;
window = _gdk_window_get_impl_window (window->parent);
_gdk_x11_window_tmp_reset_bg (window, FALSE);
}
1997-11-24 22:37:52 +00:00
void
_gdk_x11_screen_init_root_window (GdkScreen *screen)
1997-11-24 22:37:52 +00:00
{
GdkWindow *window;
GdkWindowImplX11 *impl;
GdkX11Screen *x11_screen;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
x11_screen = GDK_X11_SCREEN (screen);
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_assert (x11_screen->root_window == NULL);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
window = x11_screen->root_window = _gdk_display_create_window (gdk_screen_get_display (screen));
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
window->impl_window = window;
window->visual = gdk_screen_get_system_visual (screen);
impl = GDK_WINDOW_IMPL_X11 (window->impl);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
impl->xid = x11_screen->xroot_window;
impl->wrapper = window;
impl->window_scale = x11_screen->window_scale;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
window->window_type = GDK_WINDOW_ROOT;
window->depth = DefaultDepthOfScreen (x11_screen->xscreen);
window->x = 0;
window->y = 0;
window->abs_x = 0;
window->abs_y = 0;
window->width = WidthOfScreen (x11_screen->xscreen) / impl->window_scale;
window->height = HeightOfScreen (x11_screen->xscreen) / impl->window_scale;
window->viewable = TRUE;
/* see init_randr_support() in gdkscreen-x11.c */
window->event_mask = GDK_STRUCTURE_MASK;
_gdk_window_update_size (x11_screen->root_window);
2010-12-16 04:35:15 +00:00
_gdk_x11_display_add_window (x11_screen->display,
&x11_screen->xroot_window,
x11_screen->root_window);
1997-11-24 22:37:52 +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
static void
set_wm_protocols (GdkWindow *window)
{
GdkDisplay *display = gdk_window_get_display (window);
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
Atom protocols[4];
int n = 0;
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
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW");
protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS");
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PING");
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
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
#ifdef HAVE_XSYNC
if (GDK_X11_DISPLAY (display)->use_sync)
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST");
#endif
XSetWMProtocols (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), protocols, n);
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
}
static const gchar *
get_default_title (void)
{
const char *title;
title = g_get_application_name ();
if (!title)
title = g_get_prgname ();
if (!title)
title = "";
return title;
}
static void
check_leader_window_title (GdkDisplay *display)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
if (display_x11->leader_window && !display_x11->leader_window_title_set)
{
set_wm_name (display,
display_x11->leader_window,
get_default_title ());
display_x11->leader_window_title_set = TRUE;
}
}
static Window
2010-05-25 22:38:44 +00:00
create_focus_window (GdkDisplay *display,
XID parent)
{
GdkX11Display *display_x11;
2010-05-25 22:38:44 +00:00
GdkEventMask event_mask;
Display *xdisplay;
Window focus_window;
XSetWindowAttributes attrs;
2010-05-25 22:38:44 +00:00
xdisplay = GDK_DISPLAY_XDISPLAY (display);
display_x11 = GDK_X11_DISPLAY (display);
2010-05-25 22:38:44 +00:00
focus_window = XCreateWindow (xdisplay, parent,
-1, -1, 1, 1, 0,
0, /* depth */
InputOnly,
CopyFromParent,
0, &attrs);
2010-05-25 22:38:44 +00:00
event_mask = (GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK |
GDK_FOCUS_CHANGE_MASK);
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
focus_window,
event_mask, 0);
2010-05-25 22:38:44 +00:00
XMapWindow (xdisplay, focus_window);
return focus_window;
}
static void
ensure_sync_counter (GdkWindow *window)
{
#ifdef HAVE_XSYNC
if (!GDK_WINDOW_DESTROYED (window))
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel &&
toplevel->update_counter == None &&
GDK_X11_DISPLAY (display)->use_sync)
{
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
XSyncValue value;
Atom atom;
XID counters[2];
XSyncIntToValue (&value, 0);
toplevel->update_counter = XSyncCreateCounter (xdisplay, value);
toplevel->extended_update_counter = XSyncCreateCounter (xdisplay, value);
atom = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_SYNC_REQUEST_COUNTER");
counters[0] = toplevel->update_counter;
counters[1] = toplevel->extended_update_counter;
XChangeProperty (xdisplay, GDK_WINDOW_XID (window),
atom, XA_CARDINAL,
32, PropModeReplace,
(guchar *)counters, 2);
toplevel->current_counter_value = 0;
}
}
#endif
}
static void
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
setup_toplevel_window (GdkWindow *window,
GdkWindow *parent)
{
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkDisplay *display = gdk_window_get_display (window);
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
XID xid = GDK_WINDOW_XID (window);
GdkX11Screen *x11_screen = GDK_X11_SCREEN (GDK_WINDOW_SCREEN (parent));
XSizeHints size_hints;
long pid;
Window leader_window;
set_wm_protocols (window);
if (!window->input_only)
{
/* The focus window is off the visible area, and serves to receive key
* press events so they don't get sent to child windows.
*/
2010-05-25 22:38:44 +00:00
toplevel->focus_window = create_focus_window (display, xid);
_gdk_x11_display_add_window (x11_screen->display,
2010-12-16 04:35:15 +00:00
&toplevel->focus_window,
window);
}
2010-12-16 04:35:15 +00:00
check_leader_window_title (x11_screen->display);
2010-12-16 04:35:15 +00:00
/* FIXME: Is there any point in doing this? Do any WM's pay
* attention to PSize, and even if they do, is this the
* correct value???
*/
size_hints.flags = PSize;
size_hints.width = window->width * impl->window_scale;
size_hints.height = window->height * impl->window_scale;
XSetWMNormalHints (xdisplay, xid, &size_hints);
/* This will set WM_CLIENT_MACHINE and WM_LOCALE_NAME */
XSetWMProperties (xdisplay, xid, NULL, NULL, NULL, 0, NULL, NULL, NULL);
pid = getpid ();
XChangeProperty (xdisplay, xid,
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_PID"),
XA_CARDINAL, 32,
PropModeReplace,
(guchar *)&pid, 1);
leader_window = GDK_X11_DISPLAY (x11_screen->display)->leader_window;
if (!leader_window)
leader_window = xid;
XChangeProperty (xdisplay, xid,
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "WM_CLIENT_LEADER"),
XA_WINDOW, 32, PropModeReplace,
(guchar *) &leader_window, 1);
if (toplevel->focus_window != None)
XChangeProperty (xdisplay, xid,
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_USER_TIME_WINDOW"),
XA_WINDOW, 32, PropModeReplace,
(guchar *) &toplevel->focus_window, 1);
if (!window->focus_on_map)
gdk_x11_window_set_user_time (window, 0);
else if (GDK_X11_DISPLAY (x11_screen->display)->user_time != 0)
gdk_x11_window_set_user_time (window, GDK_X11_DISPLAY (x11_screen->display)->user_time);
ensure_sync_counter (window);
/* Start off in a frozen state - we'll finish this when we first paint */
gdk_x11_window_begin_frame (window, TRUE);
}
static void
on_frame_clock_before_paint (GdkFrameClock *clock,
GdkWindow *window)
{
gdk_x11_window_predict_presentation_time (window);
gdk_x11_window_begin_frame (window, FALSE);
}
static void
on_frame_clock_after_paint (GdkFrameClock *clock,
GdkWindow *window)
{
gdk_x11_window_end_frame (window);
}
static void
connect_frame_clock (GdkWindow *window)
{
GdkWindowImplX11 *impl;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (WINDOW_IS_TOPLEVEL (window) && !impl->frame_clock_connected)
{
GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window);
g_signal_connect (frame_clock, "before-paint",
G_CALLBACK (on_frame_clock_before_paint), window);
g_signal_connect (frame_clock, "after-paint",
G_CALLBACK (on_frame_clock_after_paint), window);
impl->frame_clock_connected = TRUE;
}
}
void
2010-12-16 00:07:36 +00:00
_gdk_x11_display_create_window_impl (GdkDisplay *display,
GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask)
1997-11-24 22:37:52 +00:00
{
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
GdkWindowImplX11 *impl;
GdkX11Screen *x11_screen;
GdkX11Display *display_x11;
2010-12-16 00:07:36 +00:00
1997-11-24 22:37:52 +00:00
Window xparent;
Visual *xvisual;
Display *xdisplay;
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
1997-11-24 22:37:52 +00:00
XSetWindowAttributes xattributes;
long xattributes_mask;
XClassHint *class_hint;
2010-12-16 00:07:36 +00:00
1997-11-24 22:37:52 +00:00
unsigned int class;
const char *title;
2010-12-16 00:07:36 +00:00
display_x11 = GDK_X11_DISPLAY (display);
xparent = GDK_WINDOW_XID (real_parent);
x11_screen = GDK_X11_SCREEN (screen);
2010-12-16 00:07:36 +00:00
impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
window->impl = GDK_WINDOW_IMPL (impl);
impl->wrapper = GDK_WINDOW (window);
impl->window_scale = x11_screen->window_scale;
2010-12-16 00:07:36 +00:00
xdisplay = x11_screen->xdisplay;
1997-11-24 22:37:52 +00:00
xattributes_mask = 0;
xvisual = gdk_x11_visual_get_xvisual (window->visual);
2010-12-16 00:07:36 +00:00
if (attributes_mask & GDK_WA_NOREDIR)
{
xattributes.override_redirect =
2010-12-16 00:07:36 +00:00
(attributes->override_redirect == FALSE)?False:True;
xattributes_mask |= CWOverrideRedirect;
2010-12-16 00:07:36 +00:00
}
else
xattributes.override_redirect = False;
2000-03-28 01:24:44 +00:00
impl->override_redirect = xattributes.override_redirect;
2010-12-16 00:07:36 +00:00
if (window->parent && window->parent->guffaw_gravity)
{
xattributes.win_gravity = StaticGravity;
xattributes_mask |= CWWinGravity;
}
2010-12-16 00:07:36 +00:00
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
/* Sanity checks */
switch (window->window_type)
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP:
if (GDK_WINDOW_TYPE (window->parent) != GDK_WINDOW_ROOT)
2010-12-16 00:07:36 +00:00
{
/* The common code warns for this case */
xparent = GDK_SCREEN_XROOTWIN (screen);
}
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
}
2010-12-16 00:07:36 +00:00
if (!window->input_only)
1997-11-24 22:37:52 +00:00
{
class = InputOutput;
2000-03-28 01:24:44 +00:00
xattributes.background_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
2000-03-28 01:24:44 +00:00
xattributes.border_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
1997-11-24 22:37:52 +00:00
xattributes_mask |= CWBorderPixel | CWBackPixel;
2000-03-28 01:24:44 +00:00
if (window->guffaw_gravity)
2010-12-16 00:07:36 +00:00
xattributes.bit_gravity = StaticGravity;
2000-03-28 01:24:44 +00:00
else
2010-12-16 00:07:36 +00:00
xattributes.bit_gravity = NorthWestGravity;
2000-03-28 01:24:44 +00:00
xattributes_mask |= CWBitGravity;
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
xattributes.colormap = _gdk_visual_get_x11_colormap (window->visual);
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
xattributes_mask |= CWColormap;
if (window->window_type == GDK_WINDOW_TEMP)
2010-12-16 00:07:36 +00:00
{
xattributes.save_under = True;
xattributes.override_redirect = True;
xattributes.cursor = None;
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
impl->override_redirect = TRUE;
}
1997-11-24 22:37:52 +00:00
}
else
{
class = InputOnly;
}
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
if (window->width * impl->window_scale > 32767 ||
window->height * impl->window_scale > 32767)
{
g_warning ("Native Windows wider or taller than 32767 pixels are not supported");
2010-12-16 00:07:36 +00:00
if (window->width * impl->window_scale > 32767)
window->width = 32767 / impl->window_scale;
if (window->height * impl->window_scale > 32767)
window->height = 32767 / impl->window_scale;
}
2010-12-16 00:07:36 +00:00
impl->xid = XCreateWindow (xdisplay, xparent,
(window->x + window->parent->abs_x) * impl->window_scale,
(window->y + window->parent->abs_y) * impl->window_scale,
window->width * impl->window_scale, window->height * impl->window_scale,
0, window->depth, class, xvisual,
xattributes_mask, &xattributes);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
g_object_ref (window);
_gdk_x11_display_add_window (x11_screen->display, &impl->xid, window);
switch (GDK_WINDOW_TYPE (window))
1997-11-24 22:37:52 +00:00
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP:
if (attributes_mask & GDK_WA_TITLE)
2010-12-16 00:07:36 +00:00
title = attributes->title;
else
2010-12-16 00:07:36 +00:00
title = get_default_title ();
gdk_window_set_title (window, title);
2010-12-16 00:07:36 +00:00
if (attributes_mask & GDK_WA_WMCLASS)
2010-12-16 00:07:36 +00:00
{
class_hint = XAllocClassHint ();
class_hint->res_name = attributes->wmclass_name;
class_hint->res_class = attributes->wmclass_class;
XSetClassHint (xdisplay, impl->xid, class_hint);
XFree (class_hint);
}
setup_toplevel_window (window, window->parent);
1997-11-24 22:37:52 +00:00
break;
1997-11-24 22:37:52 +00:00
case GDK_WINDOW_CHILD:
default:
break;
}
if (attributes_mask & GDK_WA_TYPE_HINT)
gdk_window_set_type_hint (window, attributes->type_hint);
2010-05-25 22:38:44 +00:00
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
GDK_WINDOW_XID (window), event_mask,
StructureNotifyMask | PropertyChangeMask);
connect_frame_clock (window);
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
gdk_window_freeze_toplevel_updates_libgtk_only (window);
1997-11-24 22:37:52 +00:00
}
static GdkEventMask
x_event_mask_to_gdk_event_mask (long mask)
{
GdkEventMask event_mask = 0;
int i;
for (i = 0; i < _gdk_x11_event_mask_table_size; i++)
{
if (mask & _gdk_x11_event_mask_table[i])
event_mask |= 1 << (i + 1);
}
return event_mask;
}
/**
* gdk_x11_window_foreign_new_for_display:
* @display: (type GdkX11Display): the #GdkDisplay where the window handle comes from.
* @window: an Xlib Window
*
* Wraps a native window in a #GdkWindow. The function will try to
* look up the window using gdk_x11_window_lookup_for_display() first.
* If it does not find it there, it will create a new window.
*
* This may fail if the window has been destroyed. If the window
* was already known to GDK, a new reference to the existing
* #GdkWindow is returned.
*
* Returns: (transfer full): a #GdkWindow wrapper for the native
* window, or %NULL if the window has been destroyed. The wrapper
2014-02-07 18:32:47 +00:00
* will be newly created, if one doesnt exist already.
2002-11-28 00:33:17 +00:00
*
2010-12-17 06:48:12 +00:00
* Since: 2.24
*/
1997-11-24 22:37:52 +00:00
GdkWindow *
gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
Window window)
1997-11-24 22:37:52 +00:00
{
GdkScreen *screen;
GdkWindow *win;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
GdkWindowImplX11 *impl;
GdkX11Display *display_x11;
1997-11-24 22:37:52 +00:00
XWindowAttributes attrs;
Window root, parent;
Window *children = NULL;
guint nchildren;
gboolean result;
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), NULL);
display_x11 = GDK_X11_DISPLAY (display);
2010-12-16 04:35:15 +00:00
if ((win = gdk_x11_window_lookup_for_display (display, window)) != NULL)
return g_object_ref (win);
gdk_x11_display_error_trap_push (display);
result = XGetWindowAttributes (display_x11->xdisplay, window, &attrs);
if (gdk_x11_display_error_trap_pop (display) || !result)
return NULL;
/* FIXME: This is pretty expensive.
* Maybe the caller should supply the parent
*/
gdk_x11_display_error_trap_push (display);
result = XQueryTree (display_x11->xdisplay, window, &root, &parent, &children, &nchildren);
if (gdk_x11_display_error_trap_pop (display) || !result)
return NULL;
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
if (children)
XFree (children);
screen = _gdk_x11_display_screen_for_xrootwin (display, root);
if (screen == NULL)
return NULL;
win = _gdk_display_create_window (display);
win->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
win->impl_window = win;
win->visual = gdk_x11_screen_lookup_visual (screen,
XVisualIDFromVisual (attrs.visual));
impl = GDK_WINDOW_IMPL_X11 (win->impl);
impl->wrapper = win;
impl->window_scale = GDK_X11_SCREEN (screen)->window_scale;
2010-12-16 04:35:15 +00:00
win->parent = gdk_x11_window_lookup_for_display (display, parent);
if (!win->parent || GDK_WINDOW_TYPE (win->parent) == GDK_WINDOW_FOREIGN)
win->parent = gdk_screen_get_root_window (screen);
win->parent->children = g_list_prepend (win->parent->children, win);
win->parent->impl_window->native_children =
g_list_prepend (win->parent->impl_window->native_children, win);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
impl->xid = window;
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
win->x = attrs.x / impl->window_scale;
win->y = attrs.y / impl->window_scale;
win->width = attrs.width / impl->window_scale;
win->height = attrs.height / impl->window_scale;
win->window_type = GDK_WINDOW_FOREIGN;
win->destroyed = FALSE;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
win->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
if (attrs.map_state == IsUnmapped)
win->state = GDK_WINDOW_STATE_WITHDRAWN;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
else
win->state = 0;
win->viewable = TRUE;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
win->depth = attrs.depth;
g_object_ref (win);
2010-12-16 04:35:15 +00:00
_gdk_x11_display_add_window (display, &GDK_WINDOW_XID (win), win);
/* Update the clip region, etc */
_gdk_window_update_size (win);
2009-07-18 18:29:50 +00:00
return win;
1997-11-24 22:37:52 +00:00
}
static void
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
gdk_toplevel_x11_free_contents (GdkDisplay *display,
GdkToplevelX11 *toplevel)
{
if (toplevel->icon_pixmap)
{
cairo_surface_destroy (toplevel->icon_pixmap);
toplevel->icon_pixmap = NULL;
}
if (toplevel->icon_mask)
{
cairo_surface_destroy (toplevel->icon_mask);
toplevel->icon_mask = NULL;
}
if (toplevel->group_leader)
{
g_object_unref (toplevel->group_leader);
toplevel->group_leader = NULL;
}
#ifdef HAVE_XSYNC
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
if (toplevel->update_counter != None)
{
XSyncDestroyCounter (GDK_DISPLAY_XDISPLAY (display),
toplevel->update_counter);
toplevel->update_counter = None;
toplevel->current_counter_value = 0;
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
}
#endif
}
static void
gdk_x11_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkToplevelX11 *toplevel;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
g_return_if_fail (GDK_IS_WINDOW (window));
Remove g_convert (moved to glib) and now useless utf_to_latin1() Thu Sep 14 12:21:12 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtktexttypes.[ch]: Remove g_convert (moved to glib) and now useless utf_to_latin1() latin1_to_utf() * gtk/gtktextview.[ch]: Change ::move_insert and ::delete_text action signals to ::move and ::delete; create the signals with the right enumeration type, not GTK_TYPE_ENUM so that bindings work. Add C-d, M-d, C-v bindings, change Home, End to move to beginning/end of line, Add C-Home C-End to move to beginning/end of buffer. Change ::cut_text to ::cut_clipboard, etc; combine ::scroll_text into ::move; use new GtkSelectionData functions to simplify DND text handling. * gtk/gtkenums.h gtk/gtktextview.h: Move movement, deletion enumerations here, rename enumeration values to be consistently plural. * gtk/gtktextbuffer.c: Use new clipboard interfaces for cut/copy/paste and primary selection. * gtk/gtktextbuffer.[ch]: Remove excess time and 'interactive' arguments from cut/copy/paste; rename cut to cut_clipboard, etc; remove gtk_text_buffer_get_clipboard_contents(). * gtk/gtktextlayout.[ch]: Add gtk_text_layout_move_iter_to_line_end() to move the iter to line ends. * gtk/gtkselection.[ch] (gtk_selection_data_set/get_text): Functions to set or get a UTF-8 string on the selection data. * gtk/gtkclipboard.[ch]: New, simplified selection handling interfaces. * gtk/gtkinvisible.c (gtk_invisible_new): Realize newly created widgets - one of these is useless if we don't. * gtk/gtkselection.[ch] (gtk_selection_clear_targets): Export a public function clear all targets registered for the widget. * gtk/gtkselection.c (gtk_selection_owner_set) docs/Changes-2.0.txt: Never call gtk_widget_realize() - that was just asking for bizarre side-effects. * gtk/gtkselection.c (gtk_selection_owner_set): Call gdk_selection_owner_set even if the widget is the same so that we reliably update the timestamp on the server. * gdk/x11/gdkevents-x11.c gdk/x11/gdkx.h: Add a gdk_x11_get_server_time() function. * gdk/x11/gdkevents-x11.c gdk/x11/gdkprivate-x11.h gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.h: Add some tricky filtering on serial numbers for selection clear events to fix up long-standard race condition FIXME's in gtkselection.c. * gdk/gdkproperty.h gdk/x11/gdkselection-x11.h: Add routines to convert from utf8 to compound text or STRING and from a text property to UTF-8. * gtk/gtkmain.[ch] (gtk_get_current_event_time): Add a convenience function gdk_get_current_event_time(). * gtk/gtkselection.c (gtk_selection_data_copy/free): Copy and free selection_data->data properly
2000-09-14 16:41:20 +00:00
_gdk_x11_selection_window_destroyed (window);
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel)
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
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 (impl->cairo_surface)
{
cairo_surface_finish (impl->cairo_surface);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
NULL, NULL);
}
if (!recursing && !foreign_destroy)
XDestroyWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
1997-11-24 22:37:52 +00:00
}
static void
gdk_x11_window_destroy_foreign (GdkWindow *window)
{
/* It's somebody else's window, but in our hierarchy,
* so reparent it to the root window, and then send
* it a delete event, as if we were a WM
*/
XClientMessageEvent xclient;
GdkDisplay *display;
display = GDK_WINDOW_DISPLAY (window);
gdk_x11_display_error_trap_push (display);
gdk_window_hide (window);
gdk_window_reparent (window, NULL, 0, 0);
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "WM_PROTOCOLS");
xclient.format = 32;
xclient.data.l[0] = gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW");
xclient.data.l[1] = CurrentTime;
xclient.data.l[2] = 0;
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
XSendEvent (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
False, 0, (XEvent *)&xclient);
gdk_x11_display_error_trap_pop_ignored (display);
}
static GdkWindow *
get_root (GdkWindow *window)
{
GdkScreen *screen = gdk_window_get_screen (window);
return gdk_screen_get_root_window (screen);
}
A bit of editing. Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com> * docs/Changes-1.4.txt: A bit of editing. * gdk/gdkwindow.c (_gdk_window_clear_update_area) * gdk/x11/gdkwindow-x11.c (gdk_window_hide): Add a function to clear the update area for the window, and clear it when hiding a window. * gdk/gdkwindow.c (gdk_window_begin_paint_region): Ignore if window destroyed. * gdk/gdkwindow.c (gdk_window_end_paint): Likewise. * gdk/gdkwindow.c gdk/x11/gdkwindow-x11.c gdk/gdkinternals.h: Move gdk_window_destroy() to the generic code, since there was a lot of window-system-independent logic it in. Add a function: _gdk_window_destroy() to the internal API to destroy a window without unreferencing it. Add a function: _gdk_windowing_window_destroy() That does the windowing-system-dependent part of destroying the window. Fri May 12 11:07:41 2000 Owen Taylor <otaylor@redhat.com> * gtk/testgtk.c: Fix various memory leaks of pixmaps. Fri May 12 11:06:10 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c docs/Changes-1.4.txt (gtk_widget_shape_combine_mask): Make gtk_widget_shape_combine_mask() keep a reference count on the pixmap since it keeps it around. Fri May 12 10:53:29 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_process_updates_internal): Fix refcount leak. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Fix refcount leak with event filters. Thu May 11 14:29:44 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkdnd.c (gtk_drag_dest_set_internal): Remove the signal handlers with the right data arguments. (Fixes some warnings when a widget was repeatedly set as a drag destination.) * gdk/x11/gdkdnd-x11.c (gdk_window_register_dnd): Set data on the window so we can avoid avoid setting the DND properties on the toplevel window repeatedly.
2000-05-15 16:09:53 +00:00
/* This function is called when the XWindow is really gone.
*/
static void
gdk_x11_window_destroy_notify (GdkWindow *window)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *window_impl;
window_impl = GDK_WINDOW_IMPL_X11 ((window)->impl);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (!GDK_WINDOW_DESTROYED (window))
{
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (GDK_WINDOW_TYPE(window) != GDK_WINDOW_FOREIGN)
g_warning ("GdkWindow %#lx unexpectedly destroyed", GDK_WINDOW_XID (window));
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
A bit of editing. Fri May 12 18:46:51 2000 Owen Taylor <otaylor@redhat.com> * docs/Changes-1.4.txt: A bit of editing. * gdk/gdkwindow.c (_gdk_window_clear_update_area) * gdk/x11/gdkwindow-x11.c (gdk_window_hide): Add a function to clear the update area for the window, and clear it when hiding a window. * gdk/gdkwindow.c (gdk_window_begin_paint_region): Ignore if window destroyed. * gdk/gdkwindow.c (gdk_window_end_paint): Likewise. * gdk/gdkwindow.c gdk/x11/gdkwindow-x11.c gdk/gdkinternals.h: Move gdk_window_destroy() to the generic code, since there was a lot of window-system-independent logic it in. Add a function: _gdk_window_destroy() to the internal API to destroy a window without unreferencing it. Add a function: _gdk_windowing_window_destroy() That does the windowing-system-dependent part of destroying the window. Fri May 12 11:07:41 2000 Owen Taylor <otaylor@redhat.com> * gtk/testgtk.c: Fix various memory leaks of pixmaps. Fri May 12 11:06:10 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c docs/Changes-1.4.txt (gtk_widget_shape_combine_mask): Make gtk_widget_shape_combine_mask() keep a reference count on the pixmap since it keeps it around. Fri May 12 10:53:29 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_process_updates_internal): Fix refcount leak. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Fix refcount leak with event filters. Thu May 11 14:29:44 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkdnd.c (gtk_drag_dest_set_internal): Remove the signal handlers with the right data arguments. (Fixes some warnings when a widget was repeatedly set as a drag destination.) * gdk/x11/gdkdnd-x11.c (gdk_window_register_dnd): Set data on the window so we can avoid avoid setting the DND properties on the toplevel window repeatedly.
2000-05-15 16:09:53 +00:00
_gdk_window_destroy (window, TRUE);
}
2010-12-16 04:35:15 +00:00
_gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), GDK_WINDOW_XID (window));
if (window_impl->toplevel && window_impl->toplevel->focus_window)
2010-12-16 04:35:15 +00:00
_gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), window_impl->toplevel->focus_window);
_gdk_x11_window_grab_check_destroy (window);
g_object_unref (window);
1997-11-24 22:37:52 +00:00
}
static GdkDragProtocol
gdk_x11_window_get_drag_protocol (GdkWindow *window,
GdkWindow **target)
{
GdkDragProtocol protocol;
GdkDisplay *display;
guint version;
Window xid;
display = gdk_window_get_display (window);
xid = _gdk_x11_display_get_drag_protocol (display,
GDK_WINDOW_XID (window->impl_window),
&protocol,
&version);
if (target)
{
if (xid != None)
*target = gdk_x11_window_foreign_new_for_display (display, xid);
else
*target = NULL;
}
return protocol;
}
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 void
update_wm_hints (GdkWindow *window,
gboolean force)
{
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
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
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
XWMHints wm_hints;
if (!force &&
!toplevel->is_leader &&
window->state & GDK_WINDOW_STATE_WITHDRAWN)
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;
wm_hints.flags = StateHint | InputHint;
wm_hints.input = window->accept_focus ? True : False;
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
wm_hints.initial_state = NormalState;
if (window->state & GDK_WINDOW_STATE_ICONIFIED)
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
{
wm_hints.flags |= StateHint;
wm_hints.initial_state = IconicState;
}
if (toplevel->icon_pixmap)
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
{
wm_hints.flags |= IconPixmapHint;
wm_hints.icon_pixmap = cairo_xlib_surface_get_drawable (toplevel->icon_pixmap);
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 (toplevel->icon_mask)
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
{
wm_hints.flags |= IconMaskHint;
wm_hints.icon_mask = cairo_xlib_surface_get_drawable (toplevel->icon_mask);
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
}
wm_hints.flags |= WindowGroupHint;
if (toplevel->group_leader && !GDK_WINDOW_DESTROYED (toplevel->group_leader))
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
{
wm_hints.flags |= WindowGroupHint;
wm_hints.window_group = GDK_WINDOW_XID (toplevel->group_leader);
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
}
else
wm_hints.window_group = GDK_X11_DISPLAY (display)->leader_window;
if (toplevel->urgency_hint)
wm_hints.flags |= XUrgencyHint;
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
XSetWMHints (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
&wm_hints);
}
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
static void
set_initial_hints (GdkWindow *window)
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
Window xwindow = GDK_WINDOW_XID (window);
GdkToplevelX11 *toplevel;
Atom atoms[9];
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
gint i;
toplevel = _gdk_x11_window_get_toplevel (window);
if (!toplevel)
return;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +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
update_wm_hints (window, TRUE);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
/* We set the spec hints regardless of whether the spec is supported,
* since it can't hurt and it's kind of expensive to check whether
* it's supported.
*/
i = 0;
if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
atoms[i] = gdk_x11_get_xatom_by_name_for_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
"_NET_WM_STATE_MAXIMIZED_VERT");
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
++i;
atoms[i] = gdk_x11_get_xatom_by_name_for_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
"_NET_WM_STATE_MAXIMIZED_HORZ");
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
++i;
toplevel->have_maxhorz = toplevel->have_maxvert = TRUE;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
if (window->state & GDK_WINDOW_STATE_ABOVE)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_ABOVE");
++i;
}
if (window->state & GDK_WINDOW_STATE_BELOW)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_BELOW");
++i;
}
if (window->state & GDK_WINDOW_STATE_STICKY)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
atoms[i] = gdk_x11_get_xatom_by_name_for_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
"_NET_WM_STATE_STICKY");
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
++i;
toplevel->have_sticky = TRUE;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_FULLSCREEN");
++i;
toplevel->have_fullscreen = TRUE;
}
if (window->modal_hint)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_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
"_NET_WM_STATE_MODAL");
++i;
}
if (toplevel->skip_taskbar_hint)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_SKIP_TASKBAR");
++i;
}
if (toplevel->skip_pager_hint)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_SKIP_PAGER");
++i;
}
if (window->state & GDK_WINDOW_STATE_ICONIFIED)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_HIDDEN");
++i;
toplevel->have_hidden = TRUE;
}
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
if (i > 0)
{
XChangeProperty (xdisplay,
xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
XA_ATOM, 32, PropModeReplace,
(guchar*) atoms, i);
}
else
{
XDeleteProperty (xdisplay,
xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"));
}
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
if (window->state & GDK_WINDOW_STATE_STICKY)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
atoms[0] = 0xFFFFFFFF;
XChangeProperty (xdisplay,
xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
XA_CARDINAL, 32, PropModeReplace,
(guchar*) atoms, 1);
toplevel->on_all_desktops = TRUE;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
else
{
XDeleteProperty (xdisplay,
xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"));
}
toplevel->map_serial = NextRequest (xdisplay);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
static void
gdk_window_x11_show (GdkWindow *window, gboolean already_mapped)
1997-11-24 22:37:52 +00:00
{
GdkDisplay *display;
GdkX11Display *display_x11;
GdkToplevelX11 *toplevel;
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
Window xwindow = GDK_WINDOW_XID (window);
gboolean unset_bg;
if (!already_mapped)
set_initial_hints (window);
if (WINDOW_IS_TOPLEVEL (window))
{
display = gdk_window_get_display (window);
display_x11 = GDK_X11_DISPLAY (display);
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel->user_time != 0 &&
display_x11->user_time != 0 &&
XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
gdk_x11_window_set_user_time (window, display_x11->user_time);
}
unset_bg = !window->input_only &&
(window->window_type == GDK_WINDOW_CHILD ||
impl->override_redirect) &&
gdk_window_is_viewable (window);
if (unset_bg)
_gdk_x11_window_tmp_unset_bg (window, TRUE);
XMapWindow (xdisplay, xwindow);
if (unset_bg)
_gdk_x11_window_tmp_reset_bg (window, TRUE);
/* Fullscreen on current monitor is the default, no need to apply this mode
* when mapping a window. This also ensures that the default behavior remains
* consistent with pre-fullscreen mode implementation.
*/
if (window->fullscreen_mode != GDK_FULLSCREEN_ON_CURRENT_MONITOR)
gdk_x11_window_apply_fullscreen_mode (window);
1997-11-24 22:37:52 +00:00
}
static void
pre_unmap (GdkWindow *window)
{
GdkWindow *start_window = NULL;
if (window->input_only)
return;
if (window->window_type == GDK_WINDOW_CHILD)
start_window = _gdk_window_get_impl_window ((GdkWindow *)window->parent);
else if (window->window_type == GDK_WINDOW_TEMP)
start_window = get_root (window);
if (start_window)
_gdk_x11_window_tmp_unset_bg (start_window, TRUE);
}
static void
post_unmap (GdkWindow *window)
{
GdkWindow *start_window = NULL;
if (window->input_only)
return;
if (window->window_type == GDK_WINDOW_CHILD)
start_window = _gdk_window_get_impl_window ((GdkWindow *)window->parent);
else if (window->window_type == GDK_WINDOW_TEMP)
start_window = get_root (window);
if (start_window)
{
_gdk_x11_window_tmp_reset_bg (start_window, TRUE);
if (window->window_type == GDK_WINDOW_CHILD && window->parent)
{
GdkRectangle invalid_rect;
gdk_window_get_position (window, &invalid_rect.x, &invalid_rect.y);
invalid_rect.width = gdk_window_get_width (window);
invalid_rect.height = gdk_window_get_height (window);
gdk_window_invalidate_rect ((GdkWindow *)window->parent,
&invalid_rect, TRUE);
}
}
}
static void
gdk_window_x11_hide (GdkWindow *window)
1997-11-24 22:37:52 +00:00
{
/* We'll get the unmap notify eventually, and handle it then,
* but checking here makes things more consistent if we are
* just doing stuff ourself.
*/
_gdk_x11_window_grab_check_unmap (window,
NextRequest (GDK_WINDOW_XDISPLAY (window)));
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
/* You can't simply unmap toplevel windows. */
switch (window->window_type)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP: /* ? */
gdk_window_withdraw (window);
return;
case GDK_WINDOW_FOREIGN:
case GDK_WINDOW_ROOT:
case GDK_WINDOW_CHILD:
break;
}
_gdk_window_clear_update_area (window);
pre_unmap (window);
XUnmapWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window));
post_unmap (window);
1997-11-24 22:37:52 +00:00
}
static void
gdk_window_x11_withdraw (GdkWindow *window)
{
if (!window->destroyed)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
if (GDK_WINDOW_IS_MAPPED (window))
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_WITHDRAWN);
g_assert (!GDK_WINDOW_IS_MAPPED (window));
pre_unmap (window);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
XWithdrawWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), 0);
post_unmap (window);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
}
static inline void
window_x11_move (GdkWindow *window,
gint x,
gint y)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
2000-03-28 01:24:44 +00:00
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
{
/* The window isn't actually damaged, but it's parent is */
window_pre_damage (window);
_gdk_x11_window_move_resize_child (window,
x, y,
window->width, window->height);
}
else
{
XMoveWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
x * impl->window_scale, y * impl->window_scale);
if (impl->override_redirect)
{
window->x = x;
window->y = y;
}
}
1997-11-24 22:37:52 +00:00
}
static inline void
window_x11_resize (GdkWindow *window,
gint width,
gint height)
1997-11-24 22:37:52 +00:00
{
if (width < 1)
width = 1;
1997-11-24 22:37:52 +00:00
if (height < 1)
height = 1;
window_pre_damage (window);
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
1997-11-24 22:37:52 +00:00
{
_gdk_x11_window_move_resize_child (window,
window->x, window->y,
width, height);
}
else
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
XResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
width * impl->window_scale, height * impl->window_scale);
if (impl->override_redirect)
{
window->width = width;
window->height = height;
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
if (width != window->width || height != window->height)
window->resize_count += 1;
}
1997-11-24 22:37:52 +00:00
}
}
static inline void
window_x11_move_resize (GdkWindow *window,
gint x,
gint y,
gint width,
gint height)
1997-11-24 22:37:52 +00:00
{
if (width < 1)
width = 1;
1997-11-24 22:37:52 +00:00
if (height < 1)
height = 1;
window_pre_damage (window);
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
1997-11-24 22:37:52 +00:00
{
_gdk_x11_window_move_resize_child (window, x, y, width, height);
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
x * impl->window_scale, y * impl->window_scale,
width * impl->window_scale, height * impl->window_scale);
if (impl->override_redirect)
{
window->x = x;
window->y = y;
window->width = width;
window->height = height;
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
if (width != window->width || height != window->height)
window->resize_count += 1;
}
1997-11-24 22:37:52 +00:00
}
}
static void
gdk_window_x11_move_resize (GdkWindow *window,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
if (with_move && (width < 0 && height < 0))
window_x11_move (window, x, y);
else
{
if (with_move)
window_x11_move_resize (window, x, y, width, height);
else
window_x11_resize (window, width, height);
}
}
static void
set_scale_recursive (GdkWindow *window, int scale)
{
GdkWindow *child;
GList *l;
for (l = window->children; l; l = l->next)
{
child = l->data;
if (child->impl != window->impl)
_gdk_x11_window_set_window_scale (child, scale);
else
set_scale_recursive (child, scale);
}
}
void
_gdk_x11_window_set_window_scale (GdkWindow *window,
int scale)
{
GdkWindowImplX11 *impl;
GdkToplevelX11 *toplevel;
GdkWindowHints geom_mask;
if (window->window_type == GDK_WINDOW_OFFSCREEN)
return;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
impl->window_scale = scale;
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel && window->window_type != GDK_WINDOW_FOREIGN)
{
/* These are affected by window scale: */
geom_mask = toplevel->last_geometry_hints_mask &
(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE | GDK_HINT_BASE_SIZE | GDK_HINT_RESIZE_INC);
if (geom_mask)
gdk_window_set_geometry_hints (window,
&toplevel->last_geometry_hints,
geom_mask);
}
if (window->window_type == GDK_WINDOW_FOREIGN)
XMoveWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
(window->x + window->parent->abs_x) * impl->window_scale,
(window->y + window->parent->abs_y) * impl->window_scale);
else if (WINDOW_IS_TOPLEVEL(window))
XResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
window->width * impl->window_scale,
window->height * impl->window_scale);
else
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
(window->x + window->parent->abs_x) * impl->window_scale,
(window->y + window->parent->abs_y) * impl->window_scale,
window->width * impl->window_scale,
window->height * impl->window_scale);
gdk_window_invalidate_rect (window, NULL, TRUE);
set_scale_recursive (window, scale);
}
static gboolean
gdk_window_x11_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *impl;
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
impl = GDK_WINDOW_IMPL_X11 (window->impl);
_gdk_x11_window_tmp_unset_bg (window, TRUE);
_gdk_x11_window_tmp_unset_parent_bg (window);
XReparentWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
GDK_WINDOW_XID (new_parent),
(new_parent->abs_x + x) * impl->window_scale,
(new_parent->abs_y + y) * impl->window_scale);
_gdk_x11_window_tmp_reset_parent_bg (window);
_gdk_x11_window_tmp_reset_bg (window, TRUE);
if (WINDOW_IS_TOPLEVEL (window))
connect_frame_clock (window);
else
/* old frame clock was disposed, our signal handlers removed */
impl->frame_clock_connected = FALSE;
if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
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
new_parent = gdk_screen_get_root_window (GDK_WINDOW_SCREEN (window));
window->parent = new_parent;
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
/* Switch the window type as appropriate */
switch (GDK_WINDOW_TYPE (new_parent))
{
case GDK_WINDOW_ROOT:
case GDK_WINDOW_FOREIGN:
/* Reparenting to toplevel */
if (!WINDOW_IS_TOPLEVEL (window) &&
GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
{
/* This is also done in common code at a later stage, but we
need it in setup_toplevel, so do it here too */
if (window->toplevel_window_type != -1)
GDK_WINDOW_TYPE (window) = window->toplevel_window_type;
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
GDK_WINDOW_TYPE (window) = GDK_WINDOW_TOPLEVEL;
/* Wasn't a toplevel, set up */
setup_toplevel_window (window, new_parent);
}
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
break;
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_CHILD:
case GDK_WINDOW_TEMP:
if (WINDOW_IS_TOPLEVEL (window) &&
impl->toplevel)
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
{
if (impl->toplevel->focus_window)
{
XDestroyWindow (GDK_WINDOW_XDISPLAY (window), impl->toplevel->focus_window);
2010-12-16 04:35:15 +00:00
_gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), impl->toplevel->focus_window);
}
gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window),
impl->toplevel);
g_free (impl->toplevel);
impl->toplevel = NULL;
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
}
}
return FALSE;
1997-11-24 22:37:52 +00:00
}
static void
gdk_window_x11_raise (GdkWindow *window)
1997-11-24 22:37:52 +00:00
{
XRaiseWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
}
static void
gdk_window_x11_restack_under (GdkWindow *window,
GList *native_siblings /* in requested order, first is bottom-most */)
{
Window *windows;
int n_windows, i;
GList *l;
n_windows = g_list_length (native_siblings) + 1;
windows = g_new (Window, n_windows);
windows[0] = GDK_WINDOW_XID (window);
/* Reverse order, as input order is bottom-most first */
i = n_windows - 1;
for (l = native_siblings; l != NULL; l = l->next)
windows[i--] = GDK_WINDOW_XID (l->data);
XRestackWindows (GDK_WINDOW_XDISPLAY (window), windows, n_windows);
g_free (windows);
1997-11-24 22:37:52 +00:00
}
static void
gdk_window_x11_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
gboolean above)
{
XWindowChanges changes;
changes.sibling = GDK_WINDOW_XID (sibling);
changes.stack_mode = above ? Above : Below;
XReconfigureWMWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)),
CWStackMode | CWSibling, &changes);
}
static void
gdk_window_x11_lower (GdkWindow *window)
1997-11-24 22:37:52 +00:00
{
XLowerWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
1997-11-24 22:37:52 +00:00
}
/**
* gdk_x11_window_move_to_current_desktop:
* @window: (type GdkX11Window): a #GdkWindow
*
* Moves the window to the correct workspace when running under a
* window manager that supports multiple workspaces, as described
2014-02-03 21:56:15 +00:00
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* Will not do anything if the window is already on all workspaces.
*
* Since: 2.8
*/
void
gdk_x11_window_move_to_current_desktop (GdkWindow *window)
{
GdkToplevelX11 *toplevel;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel->on_all_desktops)
return;
move_to_current_desktop (window);
}
static void
move_to_current_desktop (GdkWindow *window)
{
guint32 desktop;
desktop = gdk_x11_screen_get_current_desktop (GDK_WINDOW_SCREEN (window));
gdk_x11_window_move_to_desktop (window, desktop);
}
static guint32
get_netwm_cardinal_property (GdkWindow *window,
const gchar *name)
{
GdkScreen *screen = GDK_WINDOW_SCREEN (window);
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
GdkAtom atom;
guint32 prop = 0;
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
guchar *data;
atom = gdk_atom_intern_static_string (name);
if (!gdk_x11_screen_supports_net_wm_hint (screen, atom))
return 0;
XGetWindowProperty (x11_screen->xdisplay,
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), name),
0, G_MAXLONG,
False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, &data);
if (type == XA_CARDINAL)
{
prop = *(gulong *)data;
XFree (data);
}
return prop;
}
2013-09-17 05:13:03 +00:00
/**
* gdk_x11_window_get_desktop:
* @window: (type GdkX11Window): a #GdkWindow
2013-09-17 05:13:03 +00:00
*
* Gets the number of the workspace @window is on.
*
* Returns: the current workspace of @window
*
* Since: 3.10
*/
guint32
gdk_x11_window_get_desktop (GdkWindow *window)
{
2013-08-27 13:59:38 +00:00
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
return get_netwm_cardinal_property (window, "_NET_WM_DESKTOP");
}
/**
* gdk_x11_window_move_to_desktop:
* @window: (type GdkX11Window): a #GdkWindow
* @desktop: the number of the workspace to move the window to
*
* Moves the window to the given workspace when running unde a
* window manager that supports multiple workspaces, as described
2014-02-03 21:56:15 +00:00
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
*
* Since: 3.10
*/
void
gdk_x11_window_move_to_desktop (GdkWindow *window,
guint32 desktop)
{
GdkAtom atom;
XClientMessageEvent xclient;
g_return_if_fail (GDK_IS_WINDOW (window));
atom = gdk_atom_intern_static_string ("_NET_WM_DESKTOP");
if (!gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), atom))
return;
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.serial = 0;
xclient.send_event = True;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_atom_to_xatom_for_display (GDK_WINDOW_DISPLAY (window), atom);
xclient.format = 32;
xclient.data.l[0] = desktop;
xclient.data.l[1] = 1; /* source indication */
xclient.data.l[2] = 0;
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
XSendEvent (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XROOTWIN (window),
False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
static void
gdk_x11_window_focus (GdkWindow *window,
guint32 timestamp)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +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
GdkDisplay *display;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
return;
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
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
display = GDK_WINDOW_DISPLAY (window);
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 (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_ACTIVE_WINDOW")))
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
XClientMessageEvent xclient;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_ACTIVE_WINDOW");
xclient.format = 32;
xclient.data.l[0] = 1; /* requestor type; we're an app */
xclient.data.l[1] = timestamp;
xclient.data.l[2] = None; /* currently active window */
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +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
XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
else
{
XRaiseWindow (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window));
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
/* There is no way of knowing reliably whether we are viewable;
* so trap errors asynchronously around the XSetInputFocus call
*/
gdk_x11_display_error_trap_push (display);
XSetInputFocus (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
RevertToParent,
timestamp);
gdk_x11_display_error_trap_pop_ignored (display);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
}
static void
gdk_x11_window_set_type_hint (GdkWindow *window,
GdkWindowTypeHint hint)
{
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
GdkDisplay *display;
Atom atom;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
display = gdk_window_get_display (window);
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
switch (hint)
{
case GDK_WINDOW_TYPE_HINT_DIALOG:
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_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG");
break;
case GDK_WINDOW_TYPE_HINT_MENU:
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_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU");
break;
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
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_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR");
break;
case GDK_WINDOW_TYPE_HINT_UTILITY:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_UTILITY");
break;
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH");
break;
case GDK_WINDOW_TYPE_HINT_DOCK:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DOCK");
break;
case GDK_WINDOW_TYPE_HINT_DESKTOP:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DESKTOP");
break;
Create 'composited' label. Tue Apr 25 10:25:28 2006 Søren Sandmann <sandmann@redhat.com> * tests/testgtk.c (create_alpha_window): Create 'composited' label. * tests/testgtk.c (on_composited_changed): New function, change the label to say whether the screen is composited or not. * gtk/gtkwindow.c (gtk_window_on_composited_changed): When composited status change, invalidate the window and propagate the signal;. * gtk/gtkwindow.c (gtk_window_map): Set the appropriate type hint if reset_type_hint is TRUE. * gtk/gtkwindow.c (gtk_window_set_type_hint): If hint is one of the old hints, store a shadow copy in the public window->type_hint bitfield, otherwise set this field to normal. Set the private field to the type hint. * gtk/gtkwindow.c (gtk_window_init): Initialize priv->type_hint. * gtk/gtkwindow.c (struct _GtkWindowPrivate): New field "reset_type_hint" indicating whether the type hint needs to be reset. New field type_hint containing a GdkWindowTypeHint. * gtk/gtkwidget.c (propagate_composited_changed): New function to propagate changes in composited status. (gtk_widget_class_init): Add composited_changed signal. * gtk/gtkwidget.h (struct _GtkWidgetClass): New signal composited-changed. * gtk/gtkwidget.c (gtk_widget_is_composited): New function. * gtk/gtktooltips.c (gtk_tooltips_draw_tips): Set transient for. * gtk/gtktooltips.c (gtk_tooltips_force_window): Set the type hint * gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Compute whether the item belongs to a menubar. Set the type_hint appropriately depending on the outcome. * gtk/gtkmenu.c (gtk_menu_position): Set the default type hint here. * gtk/gtkmenu.c (gtk_menu_attach_to_widget): connect to hierarchy changed on the attach widget. * gtk/gtkmenu.c (attach_widget_hierarchy_changed): New function to set the transient_for property for menus. * gtk/gtkdnd.c (set_icon_stock_pixbuf): Set the appropriate type hint. * gtk/gtkcombo.c (gtk_combo_popup_list): Make the popup window transient for the toplevel. * gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Set transient-for, for the popup window. * gdk/x11/gdkwindow-x11.c (gdk_window_get_type_hint): Support for new window types. * gdk/x11/gdkwindow-x11.c (gdk_window_set_type_hint): Add support for new window types. * gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_process_owner_change): New function called whenever the compositing manager comes and goes. * gdk/x11/gdkscreen-x11.c (gdk_screen_is_composited): New function. * gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_request_cm_notification, make_cm_atom, check_is_composited): New functions * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call _gdk_x11_screen_process_owner_change when an XFixesSelectionNotifyEvent is received. * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Call _gdk_x11_screen_request_cm_notification() on all screens. * gdk/quartz/gdkscreen-quartz.c (gdk_screen_is_composited): Dummy implementation. * gdk/gdkscreen.c (gdk_screen_class_init): New signal, 'composited-changed'. * gdk/gdkwindow.h: Add new EWMH window types. * gdk/win32/gdkscreen-win32.c (gdk_screen_is_composited)
2006-04-25 14:27:32 +00:00
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU");
break;
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_POPUP_MENU");
break;
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLTIP");
break;
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NOTIFICATION");
break;
case GDK_WINDOW_TYPE_HINT_COMBO:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_COMBO");
break;
case GDK_WINDOW_TYPE_HINT_DND:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DND");
break;
default:
g_warning ("Unknown hint %d passed to gdk_window_set_type_hint", hint);
/* Fall thru */
case GDK_WINDOW_TYPE_HINT_NORMAL:
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_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NORMAL");
break;
}
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
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"),
XA_ATOM, 32, PropModeReplace,
(guchar *)&atom, 1);
}
static GdkWindowTypeHint
gdk_x11_window_get_type_hint (GdkWindow *window)
{
GdkDisplay *display;
GdkWindowTypeHint type;
Atom type_return;
gint format_return;
gulong nitems_return;
gulong bytes_after_return;
guchar *data = NULL;
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return GDK_WINDOW_TYPE_HINT_NORMAL;
type = GDK_WINDOW_TYPE_HINT_NORMAL;
display = gdk_window_get_display (window);
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"),
0, G_MAXLONG, False, XA_ATOM, &type_return,
&format_return, &nitems_return, &bytes_after_return,
&data) == Success)
{
if ((type_return == XA_ATOM) && (format_return == 32) &&
(data) && (nitems_return == 1))
{
Atom atom = *(Atom*)data;
if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG"))
type = GDK_WINDOW_TYPE_HINT_DIALOG;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU"))
type = GDK_WINDOW_TYPE_HINT_MENU;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR"))
type = GDK_WINDOW_TYPE_HINT_TOOLBAR;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_UTILITY"))
type = GDK_WINDOW_TYPE_HINT_UTILITY;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH"))
type = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DOCK"))
type = GDK_WINDOW_TYPE_HINT_DOCK;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DESKTOP"))
type = GDK_WINDOW_TYPE_HINT_DESKTOP;
Create 'composited' label. Tue Apr 25 10:25:28 2006 Søren Sandmann <sandmann@redhat.com> * tests/testgtk.c (create_alpha_window): Create 'composited' label. * tests/testgtk.c (on_composited_changed): New function, change the label to say whether the screen is composited or not. * gtk/gtkwindow.c (gtk_window_on_composited_changed): When composited status change, invalidate the window and propagate the signal;. * gtk/gtkwindow.c (gtk_window_map): Set the appropriate type hint if reset_type_hint is TRUE. * gtk/gtkwindow.c (gtk_window_set_type_hint): If hint is one of the old hints, store a shadow copy in the public window->type_hint bitfield, otherwise set this field to normal. Set the private field to the type hint. * gtk/gtkwindow.c (gtk_window_init): Initialize priv->type_hint. * gtk/gtkwindow.c (struct _GtkWindowPrivate): New field "reset_type_hint" indicating whether the type hint needs to be reset. New field type_hint containing a GdkWindowTypeHint. * gtk/gtkwidget.c (propagate_composited_changed): New function to propagate changes in composited status. (gtk_widget_class_init): Add composited_changed signal. * gtk/gtkwidget.h (struct _GtkWidgetClass): New signal composited-changed. * gtk/gtkwidget.c (gtk_widget_is_composited): New function. * gtk/gtktooltips.c (gtk_tooltips_draw_tips): Set transient for. * gtk/gtktooltips.c (gtk_tooltips_force_window): Set the type hint * gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Compute whether the item belongs to a menubar. Set the type_hint appropriately depending on the outcome. * gtk/gtkmenu.c (gtk_menu_position): Set the default type hint here. * gtk/gtkmenu.c (gtk_menu_attach_to_widget): connect to hierarchy changed on the attach widget. * gtk/gtkmenu.c (attach_widget_hierarchy_changed): New function to set the transient_for property for menus. * gtk/gtkdnd.c (set_icon_stock_pixbuf): Set the appropriate type hint. * gtk/gtkcombo.c (gtk_combo_popup_list): Make the popup window transient for the toplevel. * gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Set transient-for, for the popup window. * gdk/x11/gdkwindow-x11.c (gdk_window_get_type_hint): Support for new window types. * gdk/x11/gdkwindow-x11.c (gdk_window_set_type_hint): Add support for new window types. * gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_process_owner_change): New function called whenever the compositing manager comes and goes. * gdk/x11/gdkscreen-x11.c (gdk_screen_is_composited): New function. * gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_request_cm_notification, make_cm_atom, check_is_composited): New functions * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call _gdk_x11_screen_process_owner_change when an XFixesSelectionNotifyEvent is received. * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Call _gdk_x11_screen_request_cm_notification() on all screens. * gdk/quartz/gdkscreen-quartz.c (gdk_screen_is_composited): Dummy implementation. * gdk/gdkscreen.c (gdk_screen_class_init): New signal, 'composited-changed'. * gdk/gdkwindow.h: Add new EWMH window types. * gdk/win32/gdkscreen-win32.c (gdk_screen_is_composited)
2006-04-25 14:27:32 +00:00
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"))
type = GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_POPUP_MENU"))
type = GDK_WINDOW_TYPE_HINT_POPUP_MENU;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLTIP"))
type = GDK_WINDOW_TYPE_HINT_TOOLTIP;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NOTIFICATION"))
type = GDK_WINDOW_TYPE_HINT_NOTIFICATION;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_COMBO"))
type = GDK_WINDOW_TYPE_HINT_COMBO;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DND"))
type = GDK_WINDOW_TYPE_HINT_DND;
}
if (type_return != None && data != NULL)
XFree (data);
}
return type;
}
static void
gdk_wmspec_change_state (gboolean add,
GdkWindow *window,
GdkAtom state1,
GdkAtom state2)
{
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
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
XClientMessageEvent xclient;
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
#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
#define _NET_WM_STATE_ADD 1 /* add/set property */
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE");
xclient.format = 32;
xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
xclient.data.l[1] = gdk_x11_atom_to_xatom_for_display (display, state1);
xclient.data.l[2] = gdk_x11_atom_to_xatom_for_display (display, state2);
xclient.data.l[3] = 1; /* source indication */
xclient.data.l[4] = 0;
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
XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
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
static void
gdk_x11_window_set_modal_hint (GdkWindow *window,
gboolean modal)
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
window->modal_hint = modal;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (modal, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_MODAL"),
GDK_NONE);
}
static void
gdk_x11_window_set_skip_taskbar_hint (GdkWindow *window,
gboolean skips_taskbar)
{
GdkToplevelX11 *toplevel;
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
toplevel = _gdk_x11_window_get_toplevel (window);
toplevel->skip_taskbar_hint = skips_taskbar;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_taskbar, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"),
GDK_NONE);
}
static void
gdk_x11_window_set_skip_pager_hint (GdkWindow *window,
gboolean skips_pager)
{
GdkToplevelX11 *toplevel;
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
toplevel = _gdk_x11_window_get_toplevel (window);
toplevel->skip_pager_hint = skips_pager;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_pager, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"),
GDK_NONE);
}
static void
gdk_x11_window_set_urgency_hint (GdkWindow *window,
gboolean urgent)
{
GdkToplevelX11 *toplevel;
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
toplevel = _gdk_x11_window_get_toplevel (window);
toplevel->urgency_hint = urgent;
update_wm_hints (window, FALSE);
}
static void
gdk_x11_window_set_geometry_hints (GdkWindow *window,
const GdkGeometry *geometry,
GdkWindowHints geom_mask)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
XSizeHints size_hints;
GdkToplevelX11 *toplevel;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel)
{
if (geometry)
toplevel->last_geometry_hints = *geometry;
toplevel->last_geometry_hints_mask = geom_mask;
}
size_hints.flags = 0;
if (geom_mask & GDK_HINT_POS)
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
{
size_hints.flags |= PPosition;
/* We need to initialize the following obsolete fields because KWM
* apparently uses these fields if they are non-zero.
* #@#!#!$!.
*/
size_hints.x = 0;
size_hints.y = 0;
}
fix a typo. 2001-08-07 Havoc Pennington <hp@pobox.com> * gtk/gtkfilesel.c (open_ref_dir): fix a typo. * gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink; some fixage is needed here, but nothing simple. Owen understands it. ;-) * gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window sizing and positioning. Also, fix bug in compute_geometry_hints (width/height confusion for setting min size). (gtk_window_move): new function (gtk_window_resize): new function (gtk_window_get_size): new function (gtk_window_get_position): new function (gtk_window_parse_geometry): new function * gtk/gtkwidget.c (gtk_widget_set_size_request): new function (gtk_widget_get_size_request): new function (gtk_widget_get_usize): delete, that was a short-lived function ;-) (gtk_widget_set_usize): deprecate (gtk_widget_set_uposition): deprecate, make it a trivial gtk_window_move() wrapper (gtk_widget_class_init): remove x/y/width/height properties, add width_request height_request * demos/*: update to avoid deprecated functions * gtk/gtklayout.c: add x/y child properties * gtk/gtkfixed.c: add x/y child properties, and get rid of uses of "gint16" * tests/testgtk.c (create_window_sizing): lots of tweaks to window sizing test * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that configure events on toplevel windows are always in root window coordinates, following ICCCM spec that all synthetic events are in root window coords already, while real events are in parent window coords. Previously the code assumed that coords of 0,0 were parent window coords, which was really broken. * gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix warning * gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS and GDK_HINT_USER_SIZE so we can set USSize and USPosition hints in gtk_window_parse_geometry() * gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
if (geom_mask & GDK_HINT_USER_POS)
{
size_hints.flags |= USPosition;
}
if (geom_mask & GDK_HINT_USER_SIZE)
{
size_hints.flags |= USSize;
}
if (geom_mask & GDK_HINT_MIN_SIZE)
{
size_hints.flags |= PMinSize;
size_hints.min_width = geometry->min_width * impl->window_scale;
size_hints.min_height = geometry->min_height * impl->window_scale;
}
if (geom_mask & GDK_HINT_MAX_SIZE)
{
size_hints.flags |= PMaxSize;
size_hints.max_width = MAX (geometry->max_width, 1) * impl->window_scale;
size_hints.max_height = MAX (geometry->max_height, 1) * impl->window_scale;
}
if (geom_mask & GDK_HINT_BASE_SIZE)
{
size_hints.flags |= PBaseSize;
size_hints.base_width = geometry->base_width * impl->window_scale;
size_hints.base_height = geometry->base_height * impl->window_scale;
}
if (geom_mask & GDK_HINT_RESIZE_INC)
{
size_hints.flags |= PResizeInc;
size_hints.width_inc = geometry->width_inc * impl->window_scale;
size_hints.height_inc = geometry->height_inc * impl->window_scale;
}
else if (impl->window_scale > 1)
{
size_hints.flags |= PResizeInc;
size_hints.width_inc = impl->window_scale;
size_hints.height_inc = impl->window_scale;
}
if (geom_mask & GDK_HINT_ASPECT)
{
size_hints.flags |= PAspect;
if (geometry->min_aspect <= 1)
{
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
size_hints.min_aspect.x = 65536 * geometry->min_aspect;
size_hints.min_aspect.y = 65536;
}
else
{
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
size_hints.min_aspect.x = 65536;
size_hints.min_aspect.y = 65536 / geometry->min_aspect;;
}
if (geometry->max_aspect <= 1)
{
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
size_hints.max_aspect.x = 65536 * geometry->max_aspect;
size_hints.max_aspect.y = 65536;
}
else
{
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
size_hints.max_aspect.x = 65536;
size_hints.max_aspect.y = 65536 / geometry->max_aspect;;
}
}
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
if (geom_mask & GDK_HINT_WIN_GRAVITY)
{
size_hints.flags |= PWinGravity;
2001-03-29 21:17:45 +00:00
size_hints.win_gravity = geometry->win_gravity;
}
/* FIXME: Would it be better to delete this property if
[ Merges from gtk-1-2 ] Wed Sep 8 07:13:29 1999 Tim Janik <timj@gtk.org> * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. Fri Sep 3 16:04:41 1999 Tim Janik <timj@gtk.org> * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Wed Aug 25 15:45:46 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 23:16:14 1999 Tim Janik <timj@gtk.org> * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * configure.in: figure whether we have GNU Make * docs/generation.txt: minor additions/corrections. Wed Aug 11 13:38:26 BST 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: FAQ Update July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. Fri Jul 16 22:20:21 PDT 1999 Manish Singh <yosh@gimp.org> * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor <otaylor@redhat.com> * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. Mon Jul 5 20:36:03 1999 Owen Taylor <otaylor@redhat.com> * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Jun 17 13:57:31 1999 Owen Taylor <otaylor@redhat.com> * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Fri Jun 4 00:08:59 1999 Owen Taylor <otaylor@redhat.com> * TODO: Added entry about menu keyboard navigation, removed some finished items. Mon May 31 00:11:24 1999 Owen Taylor <otaylor@redhat.com> * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Wed May 5 10:47:54 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue Jun 29 15:59:25 1999 Owen Taylor <otaylor@redhat.com> * configure.in (LIBS): Look for libgmodule in the right location. Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org> * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Thu Sep 23 17:59:59 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Sat Sep 18 22:24:15 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. Sun Sep 5 08:10:53 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. Sat Sep 4 08:39:26 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 14:05:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). Tue Jun 29 23:02:42 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Thu Jun 24 17:06:23 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik <timj@gtk.org> * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Mon Jun 14 11:10:15 1999 Tim Janik <timj@gtk.org> * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com> Patch from Sung-Hyun Nam <namsh@lgic.co.kr> * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. Wed May 5 12:42:01 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete <hel@admin.de>) Wed May 5 11:38:56 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder <terra@diku.dk>) Tue May 4 11:12:56 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Mon Apr 19 10:11:12 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Tue Apr 27 11:17:35 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder <terra@diku.dk>. Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com> * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Fri Apr 16 20:41:43 PDT 1999 Manish Singh <yosh@gimp.org> * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Tue Apr 13 02:49:33 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 14:38:03 1999 Tim Janik <timj@gtk.org> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c: Add error traps so if the other end of the connection dies, we survive. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 13:21:30 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Mon Apr 5 17:11:57 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Thu Apr 1 16:58:10 PST 1999 Manish Singh <yosh@gimp.org> * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles Thu Apr 1 18:41:25 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. 1999-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Mon Mar 29 17:31:52 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se> Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org> * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>. 1999-09-21 Tor Lillqvist <tml@iki.fi>
1999-09-28 20:19:13 +00:00
* geom_mask == 0? It would save space on the server
*/
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
&size_hints);
}
2001-03-29 21:17:45 +00:00
static void
gdk_window_get_geometry_hints (GdkWindow *window,
GdkGeometry *geometry,
GdkWindowHints *geom_mask)
{
GdkWindowImplX11 *impl;
XSizeHints *size_hints;
glong junk_supplied_mask = 0;
2001-03-29 21:17:45 +00:00
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (geometry != NULL);
g_return_if_fail (geom_mask != NULL);
*geom_mask = 0;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
2001-03-29 21:17:45 +00:00
return;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
size_hints = XAllocSizeHints ();
if (!size_hints)
return;
2001-03-29 21:17:45 +00:00
if (!XGetWMNormalHints (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
size_hints,
&junk_supplied_mask))
size_hints->flags = 0;
2001-03-29 21:17:45 +00:00
if (size_hints->flags & PMinSize)
2001-03-29 21:17:45 +00:00
{
*geom_mask |= GDK_HINT_MIN_SIZE;
geometry->min_width = size_hints->min_width / impl->window_scale;
geometry->min_height = size_hints->min_height / impl->window_scale;
2001-03-29 21:17:45 +00:00
}
if (size_hints->flags & PMaxSize)
2001-03-29 21:17:45 +00:00
{
*geom_mask |= GDK_HINT_MAX_SIZE;
geometry->max_width = MAX (size_hints->max_width, 1) / impl->window_scale;
geometry->max_height = MAX (size_hints->max_height, 1) / impl->window_scale;
2001-03-29 21:17:45 +00:00
}
if (size_hints->flags & PResizeInc)
2001-03-29 21:17:45 +00:00
{
*geom_mask |= GDK_HINT_RESIZE_INC;
geometry->width_inc = size_hints->width_inc / impl->window_scale;
geometry->height_inc = size_hints->height_inc / impl->window_scale;
2001-03-29 21:17:45 +00:00
}
if (size_hints->flags & PAspect)
2001-03-29 21:17:45 +00:00
{
*geom_mask |= GDK_HINT_ASPECT;
geometry->min_aspect = (gdouble) size_hints->min_aspect.x / (gdouble) size_hints->min_aspect.y;
geometry->max_aspect = (gdouble) size_hints->max_aspect.x / (gdouble) size_hints->max_aspect.y;
2001-03-29 21:17:45 +00:00
}
if (size_hints->flags & PWinGravity)
2001-03-29 21:17:45 +00:00
{
*geom_mask |= GDK_HINT_WIN_GRAVITY;
geometry->win_gravity = size_hints->win_gravity;
2001-03-29 21:17:45 +00:00
}
XFree (size_hints);
2001-03-29 21:17:45 +00:00
}
static gboolean
utf8_is_latin1 (const gchar *str)
{
const char *p = str;
while (*p)
{
gunichar ch = g_utf8_get_char (p);
if (ch > 0xff)
return FALSE;
p = g_utf8_next_char (p);
}
return TRUE;
}
/* Set the property to @utf8_str as STRING if the @utf8_str is fully
* convertable to STRING, otherwise, set it as compound text
*/
static void
set_text_property (GdkDisplay *display,
Window xwindow,
Atom property,
const gchar *utf8_str)
{
gchar *prop_text = NULL;
Atom prop_type;
gint prop_length;
gint prop_format;
gboolean is_compound_text;
if (utf8_is_latin1 (utf8_str))
{
prop_type = XA_STRING;
prop_text = _gdk_x11_display_utf8_to_string_target (display, utf8_str);
prop_length = prop_text ? strlen (prop_text) : 0;
prop_format = 8;
is_compound_text = FALSE;
}
else
{
GdkAtom gdk_type;
gdk_x11_display_utf8_to_compound_text (display,
utf8_str, &gdk_type, &prop_format,
(guchar **)&prop_text, &prop_length);
prop_type = gdk_x11_atom_to_xatom_for_display (display, gdk_type);
is_compound_text = TRUE;
}
if (prop_text)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
xwindow,
property,
prop_type, prop_format,
PropModeReplace, (guchar *)prop_text,
prop_length);
if (is_compound_text)
gdk_x11_free_compound_text ((guchar *)prop_text);
else
g_free (prop_text);
}
}
/* Set WM_NAME and _NET_WM_NAME
*/
static void
set_wm_name (GdkDisplay *display,
Window xwindow,
const gchar *name)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_NAME"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)name, strlen (name));
set_text_property (display, xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "WM_NAME"),
name);
}
static void
gdk_x11_window_set_title (GdkWindow *window,
const gchar *title)
1997-11-24 22:37:52 +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
GdkDisplay *display;
Display *xdisplay;
Window xwindow;
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_if_fail (title != NULL);
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
display = gdk_window_get_display (window);
xdisplay = GDK_DISPLAY_XDISPLAY (display);
xwindow = GDK_WINDOW_XID (window);
set_wm_name (display, xwindow, title);
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 (!gdk_window_icon_name_set (window))
{
XChangeProperty (xdisplay, xwindow,
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_by_name_for_display (display, "_NET_WM_ICON_NAME"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)title, strlen (title));
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
set_text_property (display, xwindow,
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_by_name_for_display (display, "WM_ICON_NAME"),
title);
}
1997-11-24 22:37:52 +00:00
}
static void
gdk_x11_window_set_role (GdkWindow *window,
const gchar *role)
{
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
GdkDisplay *display;
display = gdk_window_get_display (window);
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 (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
if (role)
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "WM_WINDOW_ROLE"),
XA_STRING, 8, PropModeReplace, (guchar *)role, strlen (role));
else
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "WM_WINDOW_ROLE"));
}
static void
gdk_x11_window_set_startup_id (GdkWindow *window,
const gchar *startup_id)
{
GdkDisplay *display;
g_return_if_fail (GDK_IS_WINDOW (window));
display = gdk_window_get_display (window);
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
if (startup_id)
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (unsigned char *)startup_id, strlen (startup_id));
else
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID"));
}
static void
gdk_x11_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
if (!GDK_WINDOW_DESTROYED (window) && !GDK_WINDOW_DESTROYED (parent) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XSetTransientForHint (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
GDK_WINDOW_XID (parent));
}
static gboolean
gdk_window_x11_set_back_color (GdkWindow *window,
double red,
double green,
double blue,
double alpha)
1997-11-24 22:37:52 +00:00
{
GdkVisual *visual = gdk_window_get_visual (window);
/* I suppose we could handle these, but that'd require fiddling with
* xrender formats... */
if (alpha != 1.0)
return FALSE;
switch (visual->type)
{
case GDK_VISUAL_DIRECT_COLOR:
case GDK_VISUAL_TRUE_COLOR:
{
/* If bits not used for color are used for something other than padding,
* it's likely alpha, so we set them to 1s.
*/
guint padding, pixel;
/* Shifting by >= width-of-type isn't defined in C */
if (visual->depth >= 32)
padding = 0;
else
padding = ((~(guint32)0)) << visual->depth;
pixel = ~ (visual->red_mask | visual->green_mask | visual->blue_mask | padding);
pixel += (((int) (red * ((1 << visual->red_prec ) - 1))) << visual->red_shift ) +
(((int) (green * ((1 << visual->green_prec) - 1))) << visual->green_shift) +
(((int) (blue * ((1 << visual->blue_prec ) - 1))) << visual->blue_shift );
XSetWindowBackground (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), pixel);
}
return TRUE;
/* These require fiddling with the colormap, and as they're essentially unused
* we're just gonna skip them for now.
*/
case GDK_VISUAL_PSEUDO_COLOR:
case GDK_VISUAL_GRAYSCALE:
case GDK_VISUAL_STATIC_GRAY:
case GDK_VISUAL_STATIC_COLOR:
default:
break;
}
return FALSE;
1997-11-24 22:37:52 +00:00
}
static gboolean
matrix_is_identity (cairo_matrix_t *matrix)
{
return matrix->xx == 1.0 && matrix->yy == 1.0 &&
matrix->yx == 0.0 && matrix->xy == 0.0 &&
matrix->x0 == 0.0 && matrix->y0 == 0.0;
}
static void
gdk_window_x11_set_background (GdkWindow *window,
cairo_pattern_t *pattern)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
double r, g, b, a;
cairo_surface_t *surface;
cairo_matrix_t matrix;
if (GDK_WINDOW_DESTROYED (window))
return;
if (pattern == NULL)
{
GdkWindow *parent;
/* X throws BadMatch if the parent has a different visual when
* using ParentRelative */
parent = gdk_window_get_parent (window);
if (parent && gdk_window_get_visual (parent) == gdk_window_get_visual (window))
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), ParentRelative);
else
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
return;
}
switch (cairo_pattern_get_type (pattern))
{
case CAIRO_PATTERN_TYPE_SOLID:
cairo_pattern_get_rgba (pattern, &r, &g, &b, &a);
if (gdk_window_x11_set_back_color (window, r, g, b, a))
return;
break;
case CAIRO_PATTERN_TYPE_SURFACE:
cairo_pattern_get_matrix (pattern, &matrix);
if (cairo_pattern_get_surface (pattern, &surface) == CAIRO_STATUS_SUCCESS &&
matrix_is_identity (&matrix) &&
cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_XLIB &&
cairo_xlib_surface_get_visual (surface) == GDK_VISUAL_XVISUAL (gdk_window_get_visual ((window))) &&
cairo_xlib_surface_get_display (surface) == GDK_WINDOW_XDISPLAY (window))
{
double x, y, sx, sy;
cairo_surface_get_device_offset (surface, &x, &y);
sx = sy = 1.;
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
cairo_surface_get_device_scale (surface, &sx, &sy);
#endif
/* XXX: This still bombs for non-pixmaps, but there's no way to
* detect we're not a pixmap in Cairo... */
if (x == 0.0 && y == 0.0 &&
sx == impl->window_scale && sy == impl->window_scale)
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
cairo_xlib_surface_get_drawable (surface));
return;
}
}
/* fall through */
case CAIRO_PATTERN_TYPE_LINEAR:
case CAIRO_PATTERN_TYPE_RADIAL:
default:
/* fallback: just use black */
break;
}
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
1997-11-24 22:37:52 +00:00
}
static void
2010-05-25 22:38:44 +00:00
gdk_window_x11_set_device_cursor (GdkWindow *window,
GdkDevice *device,
GdkCursor *cursor)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *impl;
2010-05-25 22:38:44 +00:00
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_IS_DEVICE (device));
impl = GDK_WINDOW_IMPL_X11 (window->impl);
1997-11-24 22:37:52 +00:00
if (!cursor)
2010-05-25 22:38:44 +00:00
g_hash_table_remove (impl->device_cursor, device);
1997-11-24 22:37:52 +00:00
else
{
_gdk_x11_cursor_update_theme (cursor);
2010-05-25 22:38:44 +00:00
g_hash_table_replace (impl->device_cursor,
device, g_object_ref (cursor));
}
2010-05-25 22:38:44 +00:00
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (!GDK_WINDOW_DESTROYED (window))
2010-05-25 22:38:44 +00:00
GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, window, cursor);
}
GdkCursor *
_gdk_x11_window_get_cursor (GdkWindow *window)
{
GdkWindowImplX11 *impl;
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
impl = GDK_WINDOW_IMPL_X11 (window->impl);
return impl->cursor;
1997-11-24 22:37:52 +00:00
}
static void
gdk_window_x11_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *impl;
1997-11-24 22:37:52 +00:00
Window root;
gint tx;
gint ty;
guint twidth;
guint theight;
guint tborder_width;
guint tdepth;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (!GDK_WINDOW_DESTROYED (window))
{
impl = GDK_WINDOW_IMPL_X11 (window->impl);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XGetGeometry (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
if (x)
*x = tx / impl->window_scale;
if (y)
*y = ty / impl->window_scale;
if (width)
*width = twidth / impl->window_scale;
if (height)
*height = theight / impl->window_scale;
}
1997-11-24 22:37:52 +00:00
}
static void
gdk_window_x11_get_root_coords (GdkWindow *window,
gint x,
gint y,
gint *root_x,
gint *root_y)
1997-11-24 22:37:52 +00:00
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
1997-11-24 22:37:52 +00:00
Window child;
gint tx;
gint ty;
XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
GDK_WINDOW_XROOTWIN (window),
x * impl->window_scale, y * impl->window_scale, &tx, &ty,
&child);
if (root_x)
*root_x = tx / impl->window_scale;
if (root_y)
*root_y = ty / impl->window_scale;
}
static void
gdk_x11_window_get_frame_extents (GdkWindow *window,
GdkRectangle *rect)
{
GdkDisplay *display;
GdkWindowImplX11 *impl;
Window xwindow;
Window xparent;
Window root;
Window child;
Window *children;
guchar *data;
Window *vroots;
Atom type_return;
guint nchildren;
guint nvroots;
gulong nitems_return;
gulong bytes_after_return;
gint format_return;
gint i;
guint ww, wh, wb, wd;
gint wx, wy;
gboolean got_frame_extents = FALSE;
g_return_if_fail (rect != NULL);
rect->x = 0;
rect->y = 0;
rect->width = 1;
rect->height = 1;
while (window->parent && (window->parent)->parent)
window = window->parent;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
/* Refine our fallback answer a bit using local information */
rect->x = window->x * impl->window_scale;
rect->y = window->y * impl->window_scale;
rect->width = window->width * impl->window_scale;
rect->height = window->height * impl->window_scale;
if (GDK_WINDOW_DESTROYED (window) || impl->override_redirect)
return;
nvroots = 0;
vroots = NULL;
display = gdk_window_get_display (window);
gdk_x11_display_error_trap_push (display);
xwindow = GDK_WINDOW_XID (window);
/* first try: use _NET_FRAME_EXTENTS */
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
gdk_atom_intern_static_string ("_NET_FRAME_EXTENTS")) &&
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
gdk_x11_get_xatom_by_name_for_display (display,
"_NET_FRAME_EXTENTS"),
0, G_MAXLONG, False, XA_CARDINAL, &type_return,
&format_return, &nitems_return, &bytes_after_return,
&data)
== Success)
{
if ((type_return == XA_CARDINAL) && (format_return == 32) &&
(nitems_return == 4) && (data))
{
gulong *ldata = (gulong *) data;
got_frame_extents = TRUE;
/* try to get the real client window geometry */
if (XGetGeometry (GDK_DISPLAY_XDISPLAY (display), xwindow,
&root, &wx, &wy, &ww, &wh, &wb, &wd) &&
XTranslateCoordinates (GDK_DISPLAY_XDISPLAY (display),
xwindow, root, 0, 0, &wx, &wy, &child))
{
rect->x = wx;
rect->y = wy;
rect->width = ww;
rect->height = wh;
}
/* _NET_FRAME_EXTENTS format is left, right, top, bottom */
rect->x -= ldata[0];
rect->y -= ldata[2];
rect->width += ldata[0] + ldata[1];
rect->height += ldata[2] + ldata[3];
}
if (data)
XFree (data);
}
if (got_frame_extents)
goto out;
/* no frame extents property available, which means we either have a WM that
is not EWMH compliant or is broken - try fallback and walk up the window
tree to get our window's parent which hopefully is the window frame */
/* use NETWM_VIRTUAL_ROOTS if available */
root = GDK_WINDOW_XROOTWIN (window);
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
gdk_atom_intern_static_string ("_NET_VIRTUAL_ROOTS")) &&
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root,
gdk_x11_get_xatom_by_name_for_display (display,
"_NET_VIRTUAL_ROOTS"),
0, G_MAXLONG, False, XA_WINDOW, &type_return,
&format_return, &nitems_return, &bytes_after_return,
&data)
== Success)
{
if ((type_return == XA_WINDOW) && (format_return == 32) && (data))
{
nvroots = nitems_return;
vroots = (Window *)data;
}
}
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
xparent = GDK_WINDOW_XID (window);
do
{
xwindow = xparent;
if (!XQueryTree (GDK_DISPLAY_XDISPLAY (display), xwindow,
&root, &xparent,
&children, &nchildren))
goto out;
if (children)
XFree (children);
/* check virtual roots */
for (i = 0; i < nvroots; i++)
{
if (xparent == vroots[i])
{
root = xparent;
break;
}
}
}
while (xparent != root);
if (XGetGeometry (GDK_DISPLAY_XDISPLAY (display), xwindow,
&root, &wx, &wy, &ww, &wh, &wb, &wd))
{
rect->x = wx;
rect->y = wy;
rect->width = ww;
rect->height = wh;
}
out:
if (vroots)
XFree (vroots);
rect->x /= impl->window_scale;
rect->y /= impl->window_scale;
rect->width /= impl->window_scale;
rect->height /= impl->window_scale;
gdk_x11_display_error_trap_pop_ignored (display);
}
static gboolean
2010-05-25 22:38:44 +00:00
gdk_window_x11_get_device_state (GdkWindow *window,
GdkDevice *device,
gdouble *x,
gdouble *y,
2010-05-25 22:38:44 +00:00
GdkModifierType *mask)
1997-11-24 22:37:52 +00:00
{
GdkWindow *child;
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE);
if (GDK_WINDOW_DESTROYED (window))
return FALSE;
Changes multihead reorganizing code for win32 support, mostly from a patch Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com> Changes multihead reorganizing code for win32 support, mostly from a patch by Hans Breuer. * gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c gdk/gdkscreen.c gdk/x11/gdkmain-x11.c gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c gdk/x11/gdkpango-x11.c gdk/gdkselection.c gdk/x11/gdkselection-x11.c gdk/gdkwindow.c gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c: Move port-independent singlehead wrapper functions into port-independent part of GDK. (#80009) * gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c: Turn singlehead functions into "multihead" functions that ignore their GdkDisplay or GdkScreen arguments. * gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h: Misc multihead-compatibility changes. * gtk/gtk.def gdk/gdk.def: Update for multihead functions. * gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c gdk/x11/gdkvisual-x11.c: Remove the screen fields from the public parts of the colormap/visual structures, add accessors instead. * gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen for colormaps, visuals; move the fields into the private structures for the x11 backend. * gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c: Remove virtualization of screen and display functions. (#79990, patch from Erwann Chenede) * gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}: New files containing stub implementations of Display, Screen functions. * gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkx.h: Clean up function exports and what headers they are in. (#79954) * gdk/x11/gdkx.h: Fix macro that was referring to a non-existant screen->screen_num. (In the patch for #79972, Erwann Chenede) * gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer() to use window hooks. (#79972, patch partly from Erwann Chenede) * gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix some warnings.
2002-06-06 00:26:42 +00:00
/*HIDPI: handle coords here?*/
GDK_DEVICE_GET_CLASS (device)->query_state (device, window,
NULL, &child,
NULL, NULL,
x, y, mask);
return child != NULL;
}
static GdkEventMask
gdk_window_x11_get_events (GdkWindow *window)
1997-11-24 22:37:52 +00:00
{
XWindowAttributes attrs;
GdkEventMask event_mask;
GdkEventMask filtered;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (GDK_WINDOW_DESTROYED (window))
return 0;
else
1997-11-24 22:37:52 +00:00
{
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
&attrs);
event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
/* if property change was filtered out before, keep it filtered out */
filtered = GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK;
window->event_mask = event_mask & ((window->event_mask & filtered) | ~filtered);
return event_mask;
}
1997-11-24 22:37:52 +00:00
}
static void
gdk_window_x11_set_events (GdkWindow *window,
GdkEventMask event_mask)
1997-11-24 22:37:52 +00:00
{
long xevent_mask = 0;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (!GDK_WINDOW_DESTROYED (window))
1997-11-24 22:37:52 +00:00
{
GdkX11Display *display_x11;
2010-05-25 22:38:44 +00:00
if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window))
xevent_mask = StructureNotifyMask | PropertyChangeMask;
2010-05-25 22:38:44 +00:00
display_x11 = GDK_X11_DISPLAY (gdk_window_get_display (window));
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
GDK_WINDOW_XID (window), event_mask,
xevent_mask);
1997-11-24 22:37:52 +00:00
}
}
static inline void
do_shape_combine_region (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y,
gint shape)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (GDK_WINDOW_DESTROYED (window))
return;
if (shape_region == NULL)
{
/* Use NULL mask to unset the shape */
if (shape == ShapeBounding
? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
: gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
{
if (shape == ShapeBounding)
{
_gdk_x11_window_tmp_unset_parent_bg (window);
_gdk_x11_window_tmp_unset_bg (window, TRUE);
}
XShapeCombineMask (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
shape,
0, 0,
None,
ShapeSet);
if (shape == ShapeBounding)
{
_gdk_x11_window_tmp_reset_parent_bg (window);
_gdk_x11_window_tmp_reset_bg (window, TRUE);
}
}
return;
}
if (shape == ShapeBounding
? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
: gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
{
gint n_rects = 0;
XRectangle *xrects = NULL;
_gdk_x11_region_get_xrectangles (shape_region,
0, 0, impl->window_scale,
&xrects, &n_rects);
if (shape == ShapeBounding)
{
_gdk_x11_window_tmp_unset_parent_bg (window);
_gdk_x11_window_tmp_unset_bg (window, TRUE);
}
XShapeCombineRectangles (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
shape,
offset_x * impl->window_scale,
offset_y * impl->window_scale,
xrects, n_rects,
ShapeSet,
YXBanded);
if (shape == ShapeBounding)
{
_gdk_x11_window_tmp_reset_parent_bg (window);
_gdk_x11_window_tmp_reset_bg (window, TRUE);
}
g_free (xrects);
}
}
static void
gdk_window_x11_shape_combine_region (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
do_shape_combine_region (window, shape_region, offset_x, offset_y, ShapeBounding);
}
2008-12-17 10:24:46 +00:00
static void
gdk_window_x11_input_shape_combine_region (GdkWindow *window,
const cairo_region_t *shape_region,
2008-12-17 10:24:46 +00:00
gint offset_x,
gint offset_y)
{
#ifdef ShapeInput
do_shape_combine_region (window, shape_region, offset_x, offset_y, ShapeInput);
#endif
}
static void
gdk_x11_window_set_override_redirect (GdkWindow *window,
gboolean override_redirect)
{
XSetWindowAttributes attr;
if (!GDK_WINDOW_DESTROYED (window) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
attr.override_redirect = (override_redirect? True : False);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
CWOverrideRedirect,
&attr);
impl->override_redirect = attr.override_redirect;
}
}
static void
gdk_x11_window_set_accept_focus (GdkWindow *window,
gboolean accept_focus)
{
accept_focus = accept_focus != FALSE;
if (window->accept_focus != accept_focus)
{
window->accept_focus = accept_focus;
if (!GDK_WINDOW_DESTROYED (window) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
update_wm_hints (window, FALSE);
}
}
static void
gdk_x11_window_set_focus_on_map (GdkWindow *window,
gboolean focus_on_map)
{
focus_on_map = focus_on_map != FALSE;
if (window->focus_on_map != focus_on_map)
{
window->focus_on_map = focus_on_map;
if ((!GDK_WINDOW_DESTROYED (window)) &&
(!window->focus_on_map) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
gdk_x11_window_set_user_time (window, 0);
}
}
/**
* gdk_x11_window_set_user_time:
* @window: (type GdkX11Window): A toplevel #GdkWindow
* @timestamp: An XServer timestamp to which the property should be set
*
* The application can use this call to update the _NET_WM_USER_TIME
* property on a toplevel window. This property stores an Xserver
* time which represents the time of the last user input event
* received for this window. This property may be used by the window
* manager to alter the focus, stacking, and/or placement behavior of
* windows when they are mapped depending on whether the new window
* was created by a user action or is a "pop-up" window activated by a
* timer or some other event.
*
* Note that this property is automatically updated by GDK, so this
* function should only be used by applications which handle input
* events bypassing GDK.
*
* Since: 2.6
**/
void
gdk_x11_window_set_user_time (GdkWindow *window,
guint32 timestamp)
{
GdkDisplay *display;
GdkX11Display *display_x11;
GdkToplevelX11 *toplevel;
glong timestamp_long = (glong)timestamp;
Window xid;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
display = gdk_window_get_display (window);
display_x11 = GDK_X11_DISPLAY (display);
toplevel = _gdk_x11_window_get_toplevel (window);
if (!toplevel)
{
g_warning ("gdk_window_set_user_time called on non-toplevel\n");
return;
}
if (toplevel->focus_window != None &&
gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
gdk_atom_intern_static_string ("_NET_WM_USER_TIME_WINDOW")))
xid = toplevel->focus_window;
else
xid = GDK_WINDOW_XID (window);
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), xid,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
XA_CARDINAL, 32, PropModeReplace,
(guchar *)&timestamp_long, 1);
if (timestamp_long != GDK_CURRENT_TIME &&
(display_x11->user_time == GDK_CURRENT_TIME ||
XSERVER_TIME_IS_LATER (timestamp_long, display_x11->user_time)))
display_x11->user_time = timestamp_long;
if (toplevel)
toplevel->user_time = timestamp_long;
}
/**
* gdk_x11_window_set_utf8_property:
* @window: (type GdkX11Window): a #GdkWindow
* @name: Property name, will be interned as an X atom
* @value: (allow-none): Property value, or %NULL to delete
*
* This function modifies or removes an arbitrary X11 window
* property of type UTF8_STRING. If the given @window is
* not a toplevel window, it is ignored.
*
* Since: 3.4
*/
void
gdk_x11_window_set_utf8_property (GdkWindow *window,
const gchar *name,
const gchar *value)
{
GdkDisplay *display;
if (!WINDOW_IS_TOPLEVEL (window))
return;
display = gdk_window_get_display (window);
if (value != NULL)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, name),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)value, strlen (value));
}
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, name));
}
}
/**
* gdk_x11_window_set_hide_titlebar_when_maximized:
* @window: (type GdkX11Window): a #GdkWindow
* @hide_titlebar_when_maximized: whether to hide the titlebar when
* maximized
*
* Set a hint for the window manager, requesting that the titlebar
* should be hidden when the window is maximized.
*
* Note that this property is automatically updated by GTK+, so this
* function should only be used by applications which do not use GTK+
* to create toplevel windows.
*
* Since: 3.4
*/
void
gdk_x11_window_set_hide_titlebar_when_maximized (GdkWindow *window,
gboolean hide_titlebar_when_maximized)
{
GdkDisplay *display;
if (!WINDOW_IS_TOPLEVEL (window))
return;
display = gdk_window_get_display (window);
if (hide_titlebar_when_maximized)
{
gulong hide = 1;
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"),
XA_CARDINAL, 32,
PropModeReplace, (guchar *)&hide, 1);
}
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"));
}
}
static void
gdk_x11_window_set_shadow_width (GdkWindow *window,
int left,
int right,
int top,
int bottom)
{
Atom frame_extents;
gulong data[4] = { left, right, top, bottom };
frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_window_get_display (window),
"_GTK_FRAME_EXTENTS");
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
frame_extents, XA_CARDINAL,
32, PropModeReplace,
(guchar *) &data, 4);
}
/**
* gdk_x11_window_set_frame_extents:
* @window: (type GdkX11Window): a #GdkWindow
* @left: The left extent
* @right: The right extent
* @top: The top extent
* @bottom: The bottom extent
*
* This is the same as gdk_window_set_shadow_width() but it only works
* on GdkX11Window.
*
* Since: 3.10
*
* Deprecated: 3.12: Use gdk_window_set_shadow_width() instead.
*/
void
gdk_x11_window_set_frame_extents (GdkWindow *window,
int left,
int right,
int top,
int bottom)
{
gdk_x11_window_set_shadow_width (window, left, right, top, bottom);
}
/**
* gdk_x11_window_set_theme_variant:
* @window: (type GdkX11Window): a #GdkWindow
* @variant: the theme variant to export
*
* GTK+ applications can request a dark theme variant. In order to
* make other applications - namely window managers using GTK+ for
* themeing - aware of this choice, GTK+ uses this function to
* export the requested theme variant as _GTK_THEME_VARIANT property
* on toplevel windows.
*
* Note that this property is automatically updated by GTK+, so this
* function should only be used by applications which do not use GTK+
* to create toplevel windows.
*
* Since: 3.2
*/
void
gdk_x11_window_set_theme_variant (GdkWindow *window,
char *variant)
{
gdk_x11_window_set_utf8_property (window, "_GTK_THEME_VARIANT", variant);
}
#define GDK_SELECTION_MAX_SIZE(display) \
MIN(262144, \
XExtendedMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) == 0 \
? XMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) - 100 \
: XExtendedMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) - 100)
static void
gdk_window_update_icon (GdkWindow *window,
GList *icon_list)
{
GdkToplevelX11 *toplevel;
GdkPixbuf *best_icon;
GList *tmp_list;
int best_size;
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel->icon_pixmap != NULL)
{
cairo_surface_destroy (toplevel->icon_pixmap);
toplevel->icon_pixmap = NULL;
}
if (toplevel->icon_mask != NULL)
{
cairo_surface_destroy (toplevel->icon_mask);
toplevel->icon_mask = NULL;
}
#define IDEAL_SIZE 48
best_size = G_MAXINT;
best_icon = NULL;
for (tmp_list = icon_list; tmp_list; tmp_list = tmp_list->next)
{
GdkPixbuf *pixbuf = tmp_list->data;
int this;
/* average width and height - if someone passes in a rectangular
* icon they deserve what they get.
*/
this = gdk_pixbuf_get_width (pixbuf) + gdk_pixbuf_get_height (pixbuf);
this /= 2;
if (best_icon == NULL)
{
best_icon = pixbuf;
best_size = this;
}
else
{
/* icon is better if it's 32 pixels or larger, and closer to
* the ideal size than the current best.
*/
if (this >= 32 &&
(ABS (best_size - IDEAL_SIZE) <
ABS (this - IDEAL_SIZE)))
{
best_icon = pixbuf;
best_size = this;
}
}
}
if (best_icon)
{
int width = gdk_pixbuf_get_width (best_icon);
int height = gdk_pixbuf_get_height (best_icon);
cairo_t *cr;
toplevel->icon_pixmap = gdk_x11_window_create_pixmap_surface (window,
width,
height);
cr = cairo_create (toplevel->icon_pixmap);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
gdk_cairo_set_source_pixbuf (cr, best_icon, 0, 0);
if (gdk_pixbuf_get_has_alpha (best_icon))
{
/* Saturate the image, so it has bilevel alpha */
cairo_push_group_with_content (cr, CAIRO_CONTENT_COLOR_ALPHA);
cairo_paint (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_SATURATE);
cairo_paint (cr);
cairo_pop_group_to_source (cr);
}
cairo_paint (cr);
cairo_destroy (cr);
if (gdk_pixbuf_get_has_alpha (best_icon))
{
toplevel->icon_mask = _gdk_x11_window_create_bitmap_surface (window,
width,
height);
cr = cairo_create (toplevel->icon_mask);
gdk_cairo_set_source_pixbuf (cr, best_icon, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
cairo_destroy (cr);
}
}
update_wm_hints (window, FALSE);
}
static void
gdk_x11_window_set_icon_list (GdkWindow *window,
GList *pixbufs)
{
gulong *data;
guchar *pixels;
gulong *p;
gint size;
GList *l;
GdkPixbuf *pixbuf;
gint width, height, stride;
gint x, y;
gint n_channels;
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
GdkDisplay *display;
gint n;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
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 = gdk_window_get_display (window);
l = pixbufs;
size = 0;
n = 0;
while (l)
{
pixbuf = l->data;
Make gdkx.h the only installed header from gdk/x11. All structures in Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> Make gdkx.h the only installed header from gdk/x11. All structures in gdk/x11 are opaque. * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: Don't install gdk{drawable,pixmap,window}-x11.h. * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, GdkVisualClass into C files. * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} Add public functions to replace previously exported direct structure access. gdk_x11_colormap_get_{xdisplay,xcolormap} gdk_x11_cursor_get_{xdisplay,xcursor}, gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, gdk_x11_gc_get_{xdisplay,ximage} * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. Fix a number of variables and functions that were exported "accidentally" from GDK. * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, gdk_event_notify, gdk_queued_events, gdk_queued_tail, gdk_event_new, gdk_events_queue, gdk_events_unqueue, gdk_event_queue_find_first, gdk_event_queue_remove_link, gdk_event_queue_append, gdk_event_button_generate, gdk_debug_flags, gdk_default_filters, gdk_parent_root. * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, gdk_use_xshm, gdk_input_ignore_core. * gdk/x11/xsettings-common.h (xsettings_list_insert): Add #defines to namespace functions into the private _gdk_ namespace. * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () to replace gdk_parent_root exported variable. Adjust and deprecate GDK_ROOT_PARENT(). * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix GDK_ROOT_PARENT usage, remove includes of port-specific headers. * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, gdk_input_devices, _gdk_input_windows, gdk_init_input_core. * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} docs/Changes-2.0.txt: Remove gdk_wm_protocols, gdk_wm_delete_window functions, gdk_wm_take_focus, use gdk_atom_intern() instead. * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} gtk/gtkselection.c Unexport gdk_selection_property, just use gdk_atom_intern ("GDK_SELECTION"). * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, GdkVisualprivate, gdk_x11_gc_flush. Make a number of public exports of variables into functions to increase encapsulation. * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, move to gdkinternals.h. Add gdk_device_get_core_pointer (). * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, gdk_error_warnings. * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} docs/Changes-2.0.txt: s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() Add gdk_x11_get_default_xdisplay(). * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, Don't export gdk_progclass, move --class command line option and handling to common portion of GDK. Miscellaneous fixes: * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix g_return_val_if_fail that should have been g_return_if_fail. * gdk/gdkinternals.h gdk/gdkprivate.h: Move gdk_synthesize_window_state() to the semi-public gdkprivate.h. * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded X11 dependency. * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: Remove unused gdk_key_repeat_disable/restore. * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: Remove unused gdk_null_window_warnings variable. * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; it can be retrieved from the repository; it is too far from functional to be worth having people check out; it would be easier to start from scratch, I suspect. * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: Fix some accidentally global variables and unused global variables. * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: Fix some accidentally global variables and unused global variables. Add some space for future expansion to multihead. * gdk/gdkdrawable.h: Add four reserved function pointers for future expansion of GdkDrawableClass. * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer where we can put a GdkScreen * later.
2001-09-07 21:50:20 +00:00
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
/* silently ignore overlarge icons */
if (size + 2 + width * height > GDK_SELECTION_MAX_SIZE(display))
break;
n++;
size += 2 + width * height;
l = g_list_next (l);
}
data = g_malloc (size * sizeof (gulong));
l = pixbufs;
p = data;
while (l && n > 0)
{
pixbuf = l->data;
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
stride = gdk_pixbuf_get_rowstride (pixbuf);
n_channels = gdk_pixbuf_get_n_channels (pixbuf);
*p++ = width;
*p++ = height;
pixels = gdk_pixbuf_get_pixels (pixbuf);
for (y = 0; y < height; y++)
{
for (x = 0; x < width; x++)
{
guchar r, g, b, a;
r = pixels[y*stride + x*n_channels + 0];
g = pixels[y*stride + x*n_channels + 1];
b = pixels[y*stride + x*n_channels + 2];
if (n_channels >= 4)
a = pixels[y*stride + x*n_channels + 3];
else
a = 255;
*p++ = a << 24 | r << 16 | g << 8 | b ;
}
}
l = g_list_next (l);
n--;
}
if (size > 0)
{
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
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
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_by_name_for_display (display, "_NET_WM_ICON"),
XA_CARDINAL, 32,
PropModeReplace,
(guchar*) data, size);
}
else
{
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
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
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_by_name_for_display (display, "_NET_WM_ICON"));
}
g_free (data);
gdk_window_update_icon (window, pixbufs);
}
static gboolean
gdk_window_icon_name_set (GdkWindow *window)
{
return GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (window),
g_quark_from_static_string ("gdk-icon-name-set")));
}
static void
gdk_x11_window_set_icon_name (GdkWindow *window,
const gchar *name)
{
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
GdkDisplay *display;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
display = gdk_window_get_display (window);
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_object_set_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"),
GUINT_TO_POINTER (name != NULL));
if (name != NULL)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)name, strlen (name));
set_text_property (display, GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"),
name);
}
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"));
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"));
}
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
static void
gdk_x11_window_iconify (GdkWindow *window)
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
return;
if (GDK_WINDOW_IS_MAPPED (window))
{
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
XIconifyWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
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_screen_get_number (GDK_WINDOW_SCREEN (window)));
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
else
{
/* Flip our client side flag, the real work happens on map. */
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_ICONIFIED);
gdk_wmspec_change_state (TRUE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
GDK_NONE);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
}
static void
gdk_x11_window_deiconify (GdkWindow *window)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
if (GDK_WINDOW_IS_MAPPED (window))
{
gdk_window_show (window);
gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
GDK_NONE);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
else
{
/* Flip our client side flag, the real work happens on map. */
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_ICONIFIED,
0);
gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
GDK_NONE);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
}
static void
gdk_x11_window_stick (GdkWindow *window)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
return;
if (GDK_WINDOW_IS_MAPPED (window))
{
/* "stick" means stick to all desktops _and_ do not scroll with the
* viewport. i.e. glue to the monitor glass in all cases.
*/
XClientMessageEvent xclient;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
/* Request stick during viewport scroll */
gdk_wmspec_change_state (TRUE, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
GDK_NONE);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
/* Request desktop 0xFFFFFFFF */
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.display = GDK_WINDOW_XDISPLAY (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window),
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
"_NET_WM_DESKTOP");
xclient.format = 32;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
xclient.data.l[0] = 0xFFFFFFFF;
xclient.data.l[1] = 0;
xclient.data.l[2] = 0;
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
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
XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False,
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
else
{
/* Flip our client side flag, the real work happens on map. */
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_STICKY);
}
}
static void
gdk_x11_window_unstick (GdkWindow *window)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
return;
if (GDK_WINDOW_IS_MAPPED (window))
{
/* Request unstick from viewport */
gdk_wmspec_change_state (FALSE, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
GDK_NONE);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
move_to_current_desktop (window);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
else
{
/* Flip our client side flag, the real work happens on map. */
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_STICKY,
0);
}
}
static void
gdk_x11_window_maximize (GdkWindow *window)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
return;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (TRUE, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"),
gdk_atom_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ"));
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
else
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_MAXIMIZED);
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
}
static void
gdk_x11_window_unmaximize (GdkWindow *window)
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
return;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (FALSE, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"),
gdk_atom_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ"));
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
else
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED,
0);
}
static void
gdk_x11_window_apply_fullscreen_mode (GdkWindow *window)
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
/* _NET_WM_FULLSCREEN_MONITORS gives an indication to the window manager as
* to which monitors so span across when the window is fullscreen, but it's
* not a state in itself so this would have no effect if the window is not
* mapped.
*/
if (GDK_WINDOW_IS_MAPPED (window))
{
XClientMessageEvent xclient;
gint gdk_monitors[4];
gint i;
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.display = GDK_WINDOW_XDISPLAY (window);
xclient.format = 32;
switch (window->fullscreen_mode)
{
case GDK_FULLSCREEN_ON_CURRENT_MONITOR:
/* FIXME: This is not part of the EWMH spec!
*
* There is no documented mechanism to remove the property
* _NET_WM_FULLSCREEN_MONITORS once set, so we use use a set of
* invalid, largest possible value.
*
* When given values larger than actual possible monitor values, most
* window managers who support the _NET_WM_FULLSCREEN_MONITORS spec
* will simply unset _NET_WM_FULLSCREEN_MONITORS and revert to their
* default behavior.
*
* Successfully tested on mutter/metacity, kwin, compiz and xfwm4.
*
* Note, this (non documented) mechanism is unlikely to be an issue
* as it's used only for transitionning back from "all monitors" to
* "current monitor" mode.
*
* Applications who don't change the default mode won't trigger this
* mechanism.
*/
for (i = 0; i < 4; ++i)
xclient.data.l[i] = G_MAXLONG;
break;
case GDK_FULLSCREEN_ON_ALL_MONITORS:
_gdk_x11_screen_get_edge_monitors (GDK_WINDOW_SCREEN (window),
&gdk_monitors[0],
&gdk_monitors[1],
&gdk_monitors[2],
&gdk_monitors[3]);
/* Translate all 4 monitors from the GDK set into XINERAMA indices */
for (i = 0; i < 4; ++i)
{
xclient.data.l[i] = _gdk_x11_screen_get_xinerama_index (GDK_WINDOW_SCREEN (window),
gdk_monitors[i]);
/* Sanity check, if XINERAMA is not available, we could have invalid
* negative values for the XINERAMA indices.
*/
if (xclient.data.l[i] < 0)
{
g_warning ("gdk_x11_window_apply_fullscreen_mode: Invalid XINERAMA monitor index");
return;
}
}
break;
default:
g_warning ("gdk_x11_window_apply_fullscreen_mode: Unhandled fullscreen mode %d",
window->fullscreen_mode);
return;
}
/* Send fullscreen monitors client message */
xclient.data.l[4] = 1; /* source indication */
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window),
"_NET_WM_FULLSCREEN_MONITORS");
XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
}
static void
gdk_x11_window_fullscreen (GdkWindow *window)
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
if (GDK_WINDOW_IS_MAPPED (window))
{
gdk_wmspec_change_state (TRUE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
GDK_NONE);
/* Actual XRandR layout may have change since we computed the fullscreen
* monitors in GDK_FULLSCREEN_ON_ALL_MONITORS mode.
*/
if (window->fullscreen_mode == GDK_FULLSCREEN_ON_ALL_MONITORS)
gdk_x11_window_apply_fullscreen_mode (window);
}
else
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_FULLSCREEN);
}
static void
gdk_x11_window_unfullscreen (GdkWindow *window)
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (FALSE, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
GDK_NONE);
else
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_FULLSCREEN,
0);
}
static void
gdk_x11_window_set_keep_above (GdkWindow *window,
gboolean setting)
{
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
if (GDK_WINDOW_IS_MAPPED (window))
{
if (setting)
gdk_wmspec_change_state (FALSE, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
GDK_NONE);
gdk_wmspec_change_state (setting, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"),
GDK_NONE);
}
else
gdk_synthesize_window_state (window,
setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
setting ? GDK_WINDOW_STATE_ABOVE : 0);
}
static void
gdk_x11_window_set_keep_below (GdkWindow *window, gboolean setting)
{
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
if (GDK_WINDOW_IS_MAPPED (window))
{
if (setting)
gdk_wmspec_change_state (FALSE, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_ABOVE"),
GDK_NONE);
gdk_wmspec_change_state (setting, window,
2005-09-11 05:40:51 +00:00
gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
GDK_NONE);
}
else
gdk_synthesize_window_state (window,
setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
setting ? GDK_WINDOW_STATE_BELOW : 0);
}
static GdkWindow *
gdk_x11_window_get_group (GdkWindow *window)
{
GdkToplevelX11 *toplevel;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL (window))
return NULL;
toplevel = _gdk_x11_window_get_toplevel (window);
return toplevel->group_leader;
}
static void
gdk_x11_window_set_group (GdkWindow *window,
GdkWindow *leader)
{
GdkToplevelX11 *toplevel;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader));
if (GDK_WINDOW_DESTROYED (window) ||
(leader != NULL && GDK_WINDOW_DESTROYED (leader)) ||
!WINDOW_IS_TOPLEVEL (window))
return;
toplevel = _gdk_x11_window_get_toplevel (window);
if (leader == NULL)
leader = gdk_display_get_default_group (gdk_window_get_display (window));
if (toplevel->group_leader != leader)
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 (toplevel->group_leader)
g_object_unref (toplevel->group_leader);
toplevel->group_leader = g_object_ref (leader);
(_gdk_x11_window_get_toplevel (leader))->is_leader = TRUE;
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
}
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
update_wm_hints (window, FALSE);
}
static MotifWmHints *
gdk_window_get_mwm_hints (GdkWindow *window)
{
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
GdkDisplay *display;
Atom hints_atom = None;
guchar *data;
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
if (GDK_WINDOW_DESTROYED (window))
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 = gdk_window_get_display (window);
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
hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, &data);
if (type == None)
return NULL;
return (MotifWmHints *)data;
}
static void
gdk_window_set_mwm_hints (GdkWindow *window,
MotifWmHints *new_hints)
{
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
GdkDisplay *display;
Atom hints_atom = None;
guchar *data;
MotifWmHints *hints;
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (GDK_WINDOW_DESTROYED (window))
return;
display = gdk_window_get_display (window);
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
hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XGetWindowProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, &data);
if (type == None)
hints = new_hints;
else
{
hints = (MotifWmHints *)data;
if (new_hints->flags & MWM_HINTS_FUNCTIONS)
{
hints->flags |= MWM_HINTS_FUNCTIONS;
hints->functions = new_hints->functions;
}
if (new_hints->flags & MWM_HINTS_DECORATIONS)
{
hints->flags |= MWM_HINTS_DECORATIONS;
hints->decorations = new_hints->decorations;
}
}
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XChangeProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
hints_atom, hints_atom, 32, PropModeReplace,
(guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
if (hints != new_hints)
XFree (hints);
}
static void
gdk_x11_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations)
{
MotifWmHints hints;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
/* initialize to zero to avoid writing uninitialized data to socket */
memset(&hints, 0, sizeof(hints));
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = decorations;
gdk_window_set_mwm_hints (window, &hints);
}
static gboolean
gdk_x11_window_get_decorations(GdkWindow *window,
GdkWMDecoration *decorations)
{
MotifWmHints *hints;
gboolean result = FALSE;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return FALSE;
hints = gdk_window_get_mwm_hints (window);
if (hints)
{
if (hints->flags & MWM_HINTS_DECORATIONS)
{
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 (decorations)
*decorations = hints->decorations;
result = TRUE;
}
XFree (hints);
}
return result;
}
static void
gdk_x11_window_set_functions (GdkWindow *window,
GdkWMFunction functions)
{
MotifWmHints hints;
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
/* initialize to zero to avoid writing uninitialized data to socket */
memset(&hints, 0, sizeof(hints));
hints.flags = MWM_HINTS_FUNCTIONS;
hints.functions = functions;
gdk_window_set_mwm_hints (window, &hints);
}
cairo_region_t *
_gdk_x11_xwindow_get_shape (Display *xdisplay,
Window window,
gint scale,
gint shape_type)
2008-12-16 13:38:10 +00:00
{
cairo_region_t *shape;
2008-12-16 19:09:20 +00:00
GdkRectangle *rl;
XRectangle *xrl;
gint rn, ord, i;
2008-12-16 13:38:10 +00:00
shape = NULL;
rn = 0;
/* Note that XShapeGetRectangles returns NULL in two situations:
* - the server doesn't support the SHAPE extension
* - the shape is empty
*
* Since we can't discriminate these here, we always return
* an empty shape. It is the callers responsibility to check
* whether the server supports the SHAPE extensions beforehand.
*/
xrl = XShapeGetRectangles (xdisplay, window, shape_type, &rn, &ord);
if (rn == 0)
return cairo_region_create (); /* Empty */
2008-12-16 19:09:20 +00:00
if (ord != YXBanded)
2008-12-16 13:38:10 +00:00
{
2008-12-16 19:09:20 +00:00
/* This really shouldn't happen with any xserver, as they
* generally convert regions to YXBanded internally
*/
2008-12-16 19:09:20 +00:00
g_warning ("non YXBanded shape masks not supported");
XFree (xrl);
return NULL;
}
2008-12-16 13:38:10 +00:00
/* NOTE: The scale divisions here may lose some precision if someone
else set the shape to be non-scale precision */
2008-12-16 19:09:20 +00:00
rl = g_new (GdkRectangle, rn);
for (i = 0; i < rn; i++)
{
rl[i].x = xrl[i].x / scale;
rl[i].y = xrl[i].y / scale;
rl[i].width = xrl[i].width / scale;
rl[i].height = xrl[i].height / scale;
2008-12-16 13:38:10 +00:00
}
2008-12-16 19:09:20 +00:00
XFree (xrl);
shape = cairo_region_create_rectangles (rl, rn);
2008-12-16 19:09:20 +00:00
g_free (rl);
2008-12-16 19:09:20 +00:00
return shape;
}
static cairo_region_t *
gdk_x11_window_get_shape (GdkWindow *window)
2008-12-16 19:09:20 +00:00
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
2008-12-16 19:09:20 +00:00
if (!GDK_WINDOW_DESTROYED (window) &&
gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)))
return _gdk_x11_xwindow_get_shape (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
impl->window_scale,
ShapeBounding);
2008-12-16 19:09:20 +00:00
return NULL;
2008-12-16 13:38:10 +00:00
}
static cairo_region_t *
gdk_x11_window_get_input_shape (GdkWindow *window)
{
#if defined(ShapeInput)
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (!GDK_WINDOW_DESTROYED (window) &&
gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
return _gdk_x11_xwindow_get_shape (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
impl->window_scale,
ShapeInput);
#endif
2008-12-17 10:24:46 +00:00
return NULL;
}
static void
gdk_window_set_static_bit_gravity (GdkWindow *window,
gboolean on)
{
XSetWindowAttributes xattributes;
2000-03-28 01:24:44 +00:00
guint xattributes_mask = 0;
g_return_if_fail (GDK_IS_WINDOW (window));
if (window->input_only)
return;
2000-03-28 01:24:44 +00:00
xattributes.bit_gravity = StaticGravity;
xattributes_mask |= CWBitGravity;
xattributes.bit_gravity = on ? StaticGravity : ForgetGravity;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
CWBitGravity, &xattributes);
}
static void
gdk_window_set_static_win_gravity (GdkWindow *window,
gboolean on)
{
XSetWindowAttributes xattributes;
g_return_if_fail (GDK_IS_WINDOW (window));
xattributes.win_gravity = on ? StaticGravity : NorthWestGravity;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
CWWinGravity, &xattributes);
}
static gboolean
gdk_window_x11_set_static_gravities (GdkWindow *window,
gboolean use_static)
{
GList *tmp_list;
if (!use_static == !window->guffaw_gravity)
return TRUE;
window->guffaw_gravity = use_static;
Make this compile without framebuffer enabled 2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
2000-06-20 21:04:44 +00:00
if (!GDK_WINDOW_DESTROYED (window))
{
gdk_window_set_static_bit_gravity (window, use_static);
tmp_list = window->children;
while (tmp_list)
{
gdk_window_set_static_win_gravity (tmp_list->data, use_static);
tmp_list = tmp_list->next;
}
}
return TRUE;
}
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
/* From the WM spec */
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */
2001-03-29 21:17:45 +00:00
static void
wmspec_send_message (GdkDisplay *display,
GdkWindow *window,
gint root_x,
gint root_y,
gint action,
gint button)
2001-03-29 21:17:45 +00:00
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
XClientMessageEvent xclient;
2001-03-29 21:17:45 +00:00
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type =
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_by_name_for_display (display, "_NET_WM_MOVERESIZE");
xclient.format = 32;
xclient.data.l[0] = root_x * impl->window_scale;
xclient.data.l[1] = root_y * impl->window_scale;
xclient.data.l[2] = action;
xclient.data.l[3] = button;
xclient.data.l[4] = 1; /* source indication */
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
XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
2001-03-29 21:17:45 +00:00
}
static void
handle_wmspec_button_release (GdkDisplay *display,
XEvent *xevent)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
GdkWindow *window;
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 defined (HAVE_XGENERICEVENTS) && defined (XINPUT_2)
XIEvent *xiev = (XIEvent *) xevent->xcookie.data;
XIDeviceEvent *xidev = (XIDeviceEvent *) xiev;
if (xevent->xany.type == GenericEvent)
window = gdk_x11_window_lookup_for_display (display, xidev->event);
else
#endif
window = gdk_x11_window_lookup_for_display (display, xevent->xany.window);
if (display_x11->wm_moveresize_button != 0 && window != NULL)
{
if ((xevent->xany.type == ButtonRelease &&
xevent->xbutton.button == display_x11->wm_moveresize_button)
#if defined (HAVE_XGENERICEVENTS) && defined (XINPUT_2)
||
(xevent->xany.type == GenericEvent &&
xiev->evtype == XI_ButtonRelease &&
xidev->detail == display_x11->wm_moveresize_button)
#endif
)
{
display_x11->wm_moveresize_button = 0;
wmspec_send_message (display, window, 0, 0, _NET_WM_MOVERESIZE_CANCEL, 0);
}
}
}
static void
wmspec_moveresize (GdkWindow *window,
gint direction,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
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
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
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 (button != 0)
gdk_device_ungrab (device, timestamp); /* Release passive grab */
GDK_X11_DISPLAY (display)->wm_moveresize_button = button;
wmspec_send_message (display, window, root_x, root_y, direction, button);
}
2001-03-29 21:17:45 +00:00
static void
wmspec_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
GdkDevice *device,
2001-03-29 21:17:45 +00:00
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
gint direction;
if (button == 0)
direction = _NET_WM_MOVERESIZE_SIZE_KEYBOARD;
else
switch (edge)
{
/* Let the compiler turn a switch into a table, instead
* of doing the table manually, this way is easier to verify.
*/
case GDK_WINDOW_EDGE_NORTH_WEST:
direction = _NET_WM_MOVERESIZE_SIZE_TOPLEFT;
break;
2001-03-29 21:17:45 +00:00
case GDK_WINDOW_EDGE_NORTH:
direction = _NET_WM_MOVERESIZE_SIZE_TOP;
break;
2001-03-29 21:17:45 +00:00
case GDK_WINDOW_EDGE_NORTH_EAST:
direction = _NET_WM_MOVERESIZE_SIZE_TOPRIGHT;
break;
2001-03-29 21:17:45 +00:00
case GDK_WINDOW_EDGE_WEST:
direction = _NET_WM_MOVERESIZE_SIZE_LEFT;
break;
2001-03-29 21:17:45 +00:00
case GDK_WINDOW_EDGE_EAST:
direction = _NET_WM_MOVERESIZE_SIZE_RIGHT;
break;
2001-03-29 21:17:45 +00:00
case GDK_WINDOW_EDGE_SOUTH_WEST:
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT;
break;
2001-03-29 21:17:45 +00:00
case GDK_WINDOW_EDGE_SOUTH:
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOM;
break;
2001-03-29 21:17:45 +00:00
case GDK_WINDOW_EDGE_SOUTH_EAST:
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT;
break;
2001-03-29 21:17:45 +00:00
default:
g_warning ("gdk_window_begin_resize_drag: bad resize edge %d!",
edge);
return;
}
2001-03-29 21:17:45 +00:00
wmspec_moveresize (window, direction, device, button, root_x, root_y, timestamp);
2001-03-29 21:17:45 +00:00
}
typedef struct _MoveResizeData MoveResizeData;
struct _MoveResizeData
{
GdkDisplay *display;
GdkWindow *moveresize_window;
GdkWindow *moveresize_emulation_window;
gboolean is_resize;
GdkWindowEdge resize_edge;
GdkDevice *device;
gint moveresize_button;
gint moveresize_x;
gint moveresize_y;
gint moveresize_orig_x;
gint moveresize_orig_y;
gint moveresize_orig_width;
gint moveresize_orig_height;
GdkWindowHints moveresize_geom_mask;
GdkGeometry moveresize_geometry;
Time moveresize_process_time;
XEvent *moveresize_pending_event;
};
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
static MoveResizeData *
get_move_resize_data (GdkDisplay *display,
gboolean create)
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
{
MoveResizeData *mv_resize;
static GQuark move_resize_quark = 0;
if (!move_resize_quark)
move_resize_quark = g_quark_from_static_string ("gdk-window-moveresize");
mv_resize = g_object_get_qdata (G_OBJECT (display), move_resize_quark);
if (!mv_resize && create)
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
{
mv_resize = g_new0 (MoveResizeData, 1);
mv_resize->display = display;
g_object_set_qdata (G_OBJECT (display), move_resize_quark, mv_resize);
}
return mv_resize;
}
2001-03-29 21:17:45 +00:00
static void
check_maximize (MoveResizeData *mv_resize,
gdouble x_root,
gdouble y_root)
{
GdkWindowState state;
gint y;
if (mv_resize->is_resize)
return;
state = gdk_window_get_state (mv_resize->moveresize_window);
if (state & GDK_WINDOW_STATE_MAXIMIZED)
return;
y = mv_resize->moveresize_orig_y + (y_root - mv_resize->moveresize_y);
if (y < 10)
gdk_window_maximize (mv_resize->moveresize_window);
}
static void
check_unmaximize (MoveResizeData *mv_resize,
gdouble x_root,
gdouble y_root)
{
GdkWindowState state;
gint dx, dy;
if (mv_resize->is_resize)
return;
state = gdk_window_get_state (mv_resize->moveresize_window);
if ((state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED)) == 0)
return;
dx = x_root - mv_resize->moveresize_x;
dy = y_root - mv_resize->moveresize_y;
if (ABS (dx) > 20 || ABS (dy) > 20)
gdk_window_unmaximize (mv_resize->moveresize_window);
}
2001-03-29 21:17:45 +00:00
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
update_pos (MoveResizeData *mv_resize,
gint new_root_x,
gint new_root_y)
2001-03-29 21:17:45 +00:00
{
gint dx, dy;
check_unmaximize (mv_resize, new_root_x, new_root_y);
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
dx = new_root_x - mv_resize->moveresize_x;
dy = new_root_y - mv_resize->moveresize_y;
if (mv_resize->is_resize)
2001-03-29 21:17:45 +00:00
{
gint x, y, w, h;
x = mv_resize->moveresize_orig_x;
y = mv_resize->moveresize_orig_y;
2001-03-29 21:17:45 +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
w = mv_resize->moveresize_orig_width;
h = mv_resize->moveresize_orig_height;
switch (mv_resize->resize_edge)
{
case GDK_WINDOW_EDGE_NORTH_WEST:
x += dx;
y += dy;
w -= dx;
h -= dy;
break;
case GDK_WINDOW_EDGE_NORTH:
y += dy;
h -= dy;
break;
case GDK_WINDOW_EDGE_NORTH_EAST:
y += dy;
h -= dy;
w += dx;
break;
case GDK_WINDOW_EDGE_SOUTH_WEST:
h += dy;
x += dx;
w -= dx;
break;
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
case GDK_WINDOW_EDGE_SOUTH_EAST:
w += dx;
h += dy;
break;
case GDK_WINDOW_EDGE_SOUTH:
h += dy;
break;
case GDK_WINDOW_EDGE_EAST:
w += dx;
break;
case GDK_WINDOW_EDGE_WEST:
x += dx;
w -= dx;
break;
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
}
2001-03-29 21:17:45 +00:00
x = MAX (x, 0);
y = MAX (y, 0);
2001-03-29 21:17:45 +00:00
w = MAX (w, 1);
h = MAX (h, 1);
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 (mv_resize->moveresize_geom_mask)
{
gdk_window_constrain_size (&mv_resize->moveresize_geometry,
mv_resize->moveresize_geom_mask,
w, h, &w, &h);
}
gdk_window_move_resize (mv_resize->moveresize_window, x, y, w, h);
2001-03-29 21:17:45 +00:00
}
else
{
gint x, y;
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
x = mv_resize->moveresize_orig_x + dx;
y = mv_resize->moveresize_orig_y + dy;
gdk_window_move (mv_resize->moveresize_window, x, y);
2001-03-29 21:17:45 +00:00
}
}
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
finish_drag (MoveResizeData *mv_resize)
2001-03-29 21:17:45 +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_window_destroy (mv_resize->moveresize_emulation_window);
mv_resize->moveresize_emulation_window = NULL;
g_object_unref (mv_resize->moveresize_window);
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
mv_resize->moveresize_window = NULL;
2001-03-29 21:17:45 +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
if (mv_resize->moveresize_pending_event)
2001-03-29 21:17:45 +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
g_free (mv_resize->moveresize_pending_event);
mv_resize->moveresize_pending_event = NULL;
2001-03-29 21:17:45 +00:00
}
}
static int
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
lookahead_motion_predicate (Display *xdisplay,
2001-03-29 21:17:45 +00:00
XEvent *event,
XPointer arg)
{
gboolean *seen_release = (gboolean *)arg;
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
GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
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
2001-03-29 21:17:45 +00:00
if (*seen_release)
return False;
switch (event->xany.type)
{
case ButtonRelease:
*seen_release = TRUE;
break;
case MotionNotify:
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
mv_resize->moveresize_process_time = event->xmotion.time;
2001-03-29 21:17:45 +00:00
break;
default:
break;
}
return False;
}
static gboolean
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
moveresize_lookahead (MoveResizeData *mv_resize,
XEvent *event)
2001-03-29 21:17:45 +00:00
{
XEvent tmp_event;
gboolean seen_release = FALSE;
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 (mv_resize->moveresize_process_time)
2001-03-29 21:17:45 +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
if (event->xmotion.time == mv_resize->moveresize_process_time)
{
mv_resize->moveresize_process_time = 0;
return TRUE;
}
2001-03-29 21:17:45 +00:00
else
return FALSE;
2001-03-29 21:17:45 +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
XCheckIfEvent (event->xany.display, &tmp_event,
lookahead_motion_predicate, (XPointer) & seen_release);
2001-03-29 21:17:45 +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
return mv_resize->moveresize_process_time == 0;
2001-03-29 21:17:45 +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
gboolean
_gdk_x11_moveresize_handle_event (XEvent *event)
2001-03-29 21:17:45 +00:00
{
guint button_mask = 0;
GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display);
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
GdkWindowImplX11 *impl;
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 (!mv_resize || !mv_resize->moveresize_window)
{
handle_wmspec_button_release (display, event);
return FALSE;
}
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
impl = GDK_WINDOW_IMPL_X11 (mv_resize->moveresize_window->impl);
if (mv_resize->moveresize_button != 0)
button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1);
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
2001-03-29 21:17:45 +00:00
switch (event->xany.type)
{
case MotionNotify:
if (mv_resize->moveresize_window->resize_count > 0)
{
if (mv_resize->moveresize_pending_event)
*mv_resize->moveresize_pending_event = *event;
else
mv_resize->moveresize_pending_event =
g_memdup (event, sizeof (XEvent));
2001-03-29 21:17:45 +00:00
break;
}
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 (!moveresize_lookahead (mv_resize, event))
break;
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
update_pos (mv_resize,
event->xmotion.x_root / impl->window_scale,
event->xmotion.y_root / impl->window_scale);
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
2001-03-29 21:17:45 +00:00
/* This should never be triggered in normal cases, but in the
* case where the drag started without an implicit grab being
* in effect, we could miss the release if it occurs before
* we grab the pointer; this ensures that we will never
* get a permanently stuck grab.
*/
if ((event->xmotion.state & button_mask) == 0)
{
check_maximize (mv_resize,
event->xmotion.x_root / impl->window_scale,
event->xmotion.y_root / impl->window_scale);
finish_drag (mv_resize);
}
2001-03-29 21:17:45 +00:00
break;
case ButtonRelease:
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
update_pos (mv_resize,
event->xbutton.x_root / impl->window_scale,
event->xbutton.y_root / impl->window_scale);
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 (event->xbutton.button == mv_resize->moveresize_button)
{
check_maximize (mv_resize,
event->xmotion.x_root / impl->window_scale,
event->xmotion.y_root / impl->window_scale);
finish_drag (mv_resize);
}
2001-03-29 21:17:45 +00:00
break;
#if defined (HAVE_XGENERICEVENTS) && defined (XINPUT_2)
case GenericEvent:
{
/* we just assume this is an XI2 event */
XIEvent *ev = (XIEvent *) event->xcookie.data;
XIDeviceEvent *xev = (XIDeviceEvent *)ev;
gint state;
switch (ev->evtype)
{
case XI_Motion:
update_pos (mv_resize, xev->root_x / impl->window_scale, xev->root_y / impl->window_scale);
state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
if ((state & button_mask) == 0)
{
check_maximize (mv_resize,
xev->root_x / impl->window_scale,
xev->root_y / impl->window_scale);
finish_drag (mv_resize);
}
break;
case XI_ButtonRelease:
update_pos (mv_resize, xev->root_x / impl->window_scale, xev->root_y / impl->window_scale);
if (xev->detail == mv_resize->moveresize_button)
{
check_maximize (mv_resize,
xev->root_x / impl->window_scale,
xev->root_y / impl->window_scale);
finish_drag (mv_resize);
}
break;
}
}
break;
#endif
2001-03-29 21:17:45 +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
return TRUE;
2001-03-29 21:17:45 +00:00
}
gboolean
_gdk_x11_moveresize_configure_done (GdkDisplay *display,
GdkWindow *window)
2001-03-29 21:17:45 +00:00
{
XEvent *tmp_event;
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
if (!mv_resize || window != mv_resize->moveresize_window)
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
return FALSE;
if (mv_resize->moveresize_pending_event)
2001-03-29 21:17:45 +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
tmp_event = mv_resize->moveresize_pending_event;
mv_resize->moveresize_pending_event = NULL;
_gdk_x11_moveresize_handle_event (tmp_event);
2001-03-29 21:17:45 +00:00
g_free (tmp_event);
}
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
return TRUE;
2001-03-29 21:17:45 +00:00
}
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
create_moveresize_window (MoveResizeData *mv_resize,
guint32 timestamp)
2001-03-29 21:17:45 +00:00
{
GdkWindowAttr attributes;
gint attributes_mask;
GdkGrabStatus status;
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_assert (mv_resize->moveresize_emulation_window == NULL);
2001-03-29 21:17:45 +00:00
attributes.x = -100;
attributes.y = -100;
attributes.width = 10;
attributes.height = 10;
attributes.window_type = GDK_WINDOW_TEMP;
attributes.wclass = GDK_INPUT_ONLY;
attributes.override_redirect = TRUE;
attributes.event_mask = 0;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_NOREDIR;
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
mv_resize->moveresize_emulation_window =
gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (mv_resize->display)),
&attributes,
attributes_mask);
2001-03-29 21:17:45 +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_window_show (mv_resize->moveresize_emulation_window);
2001-03-29 21:17:45 +00:00
status = gdk_device_grab (mv_resize->device,
mv_resize->moveresize_emulation_window,
GDK_OWNERSHIP_NONE,
FALSE,
GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
NULL,
timestamp);
2001-03-29 21:17:45 +00:00
if (status != GDK_GRAB_SUCCESS)
{
/* If this fails, some other client has grabbed the window
* already.
*/
finish_drag (mv_resize);
2001-03-29 21:17:45 +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
mv_resize->moveresize_process_time = 0;
2001-03-29 21:17:45 +00:00
}
/*
Calculate mv_resize->moveresize_orig_x and mv_resize->moveresize_orig_y
so that calling XMoveWindow with these coordinates will not move the
window.
Note that this depends on the WM to implement ICCCM-compliant reference
point handling.
*/
static void
calculate_unmoving_origin (MoveResizeData *mv_resize)
{
GdkRectangle rect;
gint width, height;
if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY &&
mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC)
{
gdk_window_get_origin (mv_resize->moveresize_window,
&mv_resize->moveresize_orig_x,
&mv_resize->moveresize_orig_y);
}
else
{
gdk_window_get_frame_extents (mv_resize->moveresize_window, &rect);
gdk_window_get_geometry (mv_resize->moveresize_window,
NULL, NULL, &width, &height);
switch (mv_resize->moveresize_geometry.win_gravity)
{
case GDK_GRAVITY_NORTH_WEST:
mv_resize->moveresize_orig_x = rect.x;
mv_resize->moveresize_orig_y = rect.y;
break;
case GDK_GRAVITY_NORTH:
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
mv_resize->moveresize_orig_y = rect.y;
break;
case GDK_GRAVITY_NORTH_EAST:
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
mv_resize->moveresize_orig_y = rect.y;
break;
case GDK_GRAVITY_WEST:
mv_resize->moveresize_orig_x = rect.x;
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
break;
case GDK_GRAVITY_CENTER:
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
break;
case GDK_GRAVITY_EAST:
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
break;
case GDK_GRAVITY_SOUTH_WEST:
mv_resize->moveresize_orig_x = rect.x;
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
break;
case GDK_GRAVITY_SOUTH:
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
break;
case GDK_GRAVITY_SOUTH_EAST:
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
break;
default:
mv_resize->moveresize_orig_x = rect.x;
mv_resize->moveresize_orig_y = rect.y;
break;
}
}
}
2001-03-29 21:17:45 +00:00
static void
emulate_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
GdkDevice *device,
2001-03-29 21:17:45 +00:00
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
2001-03-29 21:17:45 +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
mv_resize->is_resize = TRUE;
mv_resize->moveresize_button = button;
mv_resize->resize_edge = edge;
mv_resize->device = device;
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
mv_resize->moveresize_x = root_x;
mv_resize->moveresize_y = root_y;
mv_resize->moveresize_window = g_object_ref (window);
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
mv_resize->moveresize_orig_width = gdk_window_get_width (window);
mv_resize->moveresize_orig_height = gdk_window_get_height (window);
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
mv_resize->moveresize_geom_mask = 0;
2001-03-29 21:17:45 +00:00
gdk_window_get_geometry_hints (window,
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
&mv_resize->moveresize_geometry,
&mv_resize->moveresize_geom_mask);
calculate_unmoving_origin (mv_resize);
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
create_moveresize_window (mv_resize, timestamp);
2001-03-29 21:17:45 +00:00
}
static void
emulate_move_drag (GdkWindow *window,
GdkDevice *device,
2001-03-29 21:17:45 +00:00
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
2001-03-29 21:17:45 +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
mv_resize->is_resize = FALSE;
mv_resize->device = device;
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
mv_resize->moveresize_button = button;
mv_resize->moveresize_x = root_x;
mv_resize->moveresize_y = root_y;
mv_resize->moveresize_window = g_object_ref (window);
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
calculate_unmoving_origin (mv_resize);
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
create_moveresize_window (mv_resize, timestamp);
2001-03-29 21:17:45 +00:00
}
static gboolean
_should_perform_ewmh_drag (GdkWindow *window,
GdkDevice *device)
{
GdkPointerWindowInfo *info;
GdkDisplay *display;
display = gdk_window_get_display (window);
info = _gdk_display_get_pointer_info (display, device);
if ((!info->last_slave || gdk_device_get_source (info->last_slave) != GDK_SOURCE_TOUCHSCREEN) &&
gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
gdk_atom_intern_static_string ("_NET_WM_MOVERESIZE")))
return TRUE;
return FALSE;
}
static void
gdk_x11_window_begin_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
2001-03-29 21:17:45 +00:00
{
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
2001-03-29 21:17:45 +00:00
return;
/* Avoid EWMH for touch devices */
if (_should_perform_ewmh_drag (window, device))
wmspec_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
2001-03-29 21:17:45 +00:00
else
emulate_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
2001-03-29 21:17:45 +00:00
}
static void
gdk_x11_window_begin_move_drag (GdkWindow *window,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
2001-03-29 21:17:45 +00:00
{
gint direction;
if (GDK_WINDOW_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window))
2001-03-29 21:17:45 +00:00
return;
if (button == 0)
direction = _NET_WM_MOVERESIZE_MOVE_KEYBOARD;
else
direction = _NET_WM_MOVERESIZE_MOVE;
/* Avoid EWMH for touch devices */
if (_should_perform_ewmh_drag (window, device))
wmspec_moveresize (window, direction, device, button, root_x, root_y, timestamp);
2001-03-29 21:17:45 +00:00
else
emulate_move_drag (window, device, button, root_x, root_y, timestamp);
2001-03-29 21:17:45 +00:00
}
Bug 143330, support update counter spec. Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk> Bug 143330, support update counter spec. * configure.in: Add check for the Sync extension * gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and gdk_window_configure_finished() * gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure(). * gtk/gtkwindow.c (gtk_window_realize): Automatically enable synchronized configures. * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current and pending counter values. * gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function. * gdk/x11/gdkwindow-x11.c (gdk_window_enable_synchronized_configure): New function. * gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents): Delete update counter. * gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise _NET_WM_SYNC_REQUEST when Sync is available * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle _NET_WM_SYNC_REQUEST messages * gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter value for use by gdk_window_configure_finished() when receiving ConfigureNotifies. * gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync extension is available * gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and _NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms. * gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add stubs for enable_synchronized_configure() and configure_finished()
2004-07-11 13:26:57 +00:00
static gboolean
gdk_x11_window_beep (GdkWindow *window)
{
2006-08-30 16:02:41 +00:00
GdkDisplay *display;
display = GDK_WINDOW_DISPLAY (window);
#ifdef HAVE_XKB
if (GDK_X11_DISPLAY (display)->use_xkb)
{
XkbBell (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
0,
None);
return TRUE;
}
#endif
return FALSE;
}
static void
gdk_x11_window_set_opacity (GdkWindow *window,
gdouble opacity)
{
GdkDisplay *display;
gulong cardinal;
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL (window))
return;
display = gdk_window_get_display (window);
if (opacity < 0)
opacity = 0;
else if (opacity > 1)
opacity = 1;
cardinal = opacity * 0xffffffff;
if (cardinal == 0xffffffff)
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_OPACITY"));
else
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_OPACITY"),
XA_CARDINAL, 32,
PropModeReplace,
(guchar *) &cardinal, 1);
}
static void
gdk_x11_window_set_composited (GdkWindow *window,
gboolean composited)
{
#if defined(HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && defined (HAVE_XFIXES)
GdkWindowImplX11 *impl;
GdkDisplay *display;
Display *dpy;
Window xid;
impl = GDK_WINDOW_IMPL_X11 (window->impl);
display = gdk_window_get_display (window);
dpy = GDK_DISPLAY_XDISPLAY (display);
xid = GDK_WINDOW_XID (window);
if (composited)
{
XCompositeRedirectWindow (dpy, xid, CompositeRedirectManual);
impl->damage = XDamageCreate (dpy, xid, XDamageReportBoundingBox);
}
else
{
XCompositeUnredirectWindow (dpy, xid, CompositeRedirectManual);
XDamageDestroy (dpy, impl->damage);
impl->damage = None;
}
#endif
}
void
_gdk_x11_display_before_process_all_updates (GdkDisplay *display)
{
}
void
_gdk_x11_display_after_process_all_updates (GdkDisplay *display)
{
/* Sync after all drawing, otherwise the client can get "ahead" of
the server rendering during animations, such that we fill up
the Xserver pipes with sync rendering ops not letting other
clients (including the VM) do anything. */
XSync (GDK_DISPLAY_XDISPLAY (display), FALSE);
}
2010-05-25 22:38:44 +00:00
static Bool
timestamp_predicate (Display *display,
XEvent *xevent,
XPointer arg)
{
Window xwindow = GPOINTER_TO_UINT (arg);
GdkDisplay *gdk_display = gdk_x11_lookup_xdisplay (display);
if (xevent->type == PropertyNotify &&
xevent->xproperty.window == xwindow &&
xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (gdk_display,
"GDK_TIMESTAMP_PROP"))
return True;
return False;
}
/**
* gdk_x11_get_server_time:
* @window: (type GdkX11Window): a #GdkWindow, used for communication
* with the server. The window must have
* GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will
* result.
2010-05-25 22:38:44 +00:00
*
* Routine to get the current X server time stamp.
*
* Returns: the time stamp.
2010-05-25 22:38:44 +00:00
**/
guint32
gdk_x11_get_server_time (GdkWindow *window)
{
Display *xdisplay;
Window xwindow;
guchar c = 'a';
XEvent xevent;
Atom timestamp_prop_atom;
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), 0);
xdisplay = GDK_WINDOW_XDISPLAY (window);
xwindow = GDK_WINDOW_XID (window);
2010-05-25 22:38:44 +00:00
timestamp_prop_atom =
gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window),
"GDK_TIMESTAMP_PROP");
XChangeProperty (xdisplay, xwindow, timestamp_prop_atom,
timestamp_prop_atom,
8, PropModeReplace, &c, 1);
XIfEvent (xdisplay, &xevent,
timestamp_predicate, GUINT_TO_POINTER(xwindow));
return xevent.xproperty.time;
}
/**
* gdk_x11_window_get_xid:
* @window: (type GdkX11Window): a native #GdkWindow.
*
* Returns the X resource (window) belonging to a #GdkWindow.
*
* Returns: the ID of @drawables X resource.
**/
XID
gdk_x11_window_get_xid (GdkWindow *window)
{
/* Try to ensure the window has a native window */
if (!_gdk_window_has_impl (window))
{
gdk_window_ensure_native (window);
/* We sync here to ensure the window is created in the Xserver when
* this function returns. This is required because the returned XID
* for this window must be valid immediately, even with another
* connection to the Xserver */
gdk_display_sync (gdk_window_get_display (window));
}
if (!GDK_WINDOW_IS_X11 (window))
{
g_warning (G_STRLOC " drawable is not a native X11 window");
return None;
}
return GDK_WINDOW_IMPL_X11 (window->impl)->xid;
}
static gint
gdk_x11_window_get_scale_factor (GdkWindow *window)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (GDK_WINDOW_DESTROYED (window))
return 1;
return impl->window_scale;
}
/**
* gdk_x11_window_set_frame_sync_enabled:
* @window: (type GdkX11Window): a native #GdkWindow
* @frame_sync_enabled: whether frame-synchronization should be enabled
*
* This function can be used to disable frame synchronization for a window.
* Normally frame synchronziation will be enabled or disabled based on whether
* the system has a compositor that supports frame synchronization, but if
* the window is not directly managed by the window manager, then frame
* synchronziation may need to be disabled. This is the case for a window
* embedded via the XEMBED protocol.
*
* Since: 3.8
*/
void
gdk_x11_window_set_frame_sync_enabled (GdkWindow *window,
gboolean frame_sync_enabled)
{
/* Try to ensure the window has a native window */
if (!_gdk_window_has_impl (window))
gdk_window_ensure_native (window);
if (!GDK_WINDOW_IS_X11 (window))
{
g_warning (G_STRLOC " drawable is not a native X11 window");
return;
}
GDK_WINDOW_IMPL_X11 (window->impl)->frame_sync_enabled = FALSE;
}
static void
gdk_x11_window_set_opaque_region (GdkWindow *window,
cairo_region_t *region)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkDisplay *display;
int nitems;
gulong *data;
if (GDK_WINDOW_DESTROYED (window))
return;
if (region != NULL)
{
int i, nrects;
nrects = cairo_region_num_rectangles (region);
nitems = nrects * 4;
data = g_new (gulong, nitems);
for (i = 0; i < nrects; i++)
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (region, i, &rect);
data[i*4+0] = rect.x * impl->window_scale;
data[i*4+1] = rect.y * impl->window_scale;
data[i*4+2] = rect.width * impl->window_scale;
data[i*4+3] = rect.height * impl->window_scale;
}
}
else
{
nitems = 0;
data = NULL;
}
display = gdk_window_get_display (window);
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_OPAQUE_REGION"),
XA_CARDINAL, 32, PropModeReplace,
(guchar *) data, nitems);
if (data != NULL)
g_free (data);
}
static gboolean
gdk_x11_window_show_window_menu (GdkWindow *window,
GdkEvent *event)
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
GdkDevice *device;
int device_id;
double x_root, y_root;
XClientMessageEvent xclient = { 0 };
switch (event->type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
break;
default:
return FALSE;
}
if (!gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
gdk_atom_intern_static_string ("_GTK_SHOW_WINDOW_MENU")))
return FALSE;
gdk_event_get_root_coords (event, &x_root, &y_root);
device = gdk_event_get_device (event);
g_object_get (G_OBJECT (device),
"device-id", &device_id,
NULL);
2014-05-22 19:01:36 +00:00
/* Ungrab the implicit grab */
gdk_device_ungrab (device, gdk_event_get_time (event));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_GTK_SHOW_WINDOW_MENU");
xclient.data.l[0] = device_id;
xclient.data.l[1] = x_root;
xclient.data.l[2] = y_root;
xclient.format = 32;
XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
return TRUE;
}
static void
gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
object_class->finalize = gdk_window_impl_x11_finalize;
impl_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
impl_class->show = gdk_window_x11_show;
impl_class->hide = gdk_window_x11_hide;
impl_class->withdraw = gdk_window_x11_withdraw;
impl_class->set_events = gdk_window_x11_set_events;
impl_class->get_events = gdk_window_x11_get_events;
impl_class->raise = gdk_window_x11_raise;
impl_class->lower = gdk_window_x11_lower;
impl_class->restack_under = gdk_window_x11_restack_under;
impl_class->restack_toplevel = gdk_window_x11_restack_toplevel;
impl_class->move_resize = gdk_window_x11_move_resize;
impl_class->set_background = gdk_window_x11_set_background;
impl_class->reparent = gdk_window_x11_reparent;
impl_class->set_device_cursor = gdk_window_x11_set_device_cursor;
impl_class->get_geometry = gdk_window_x11_get_geometry;
impl_class->get_root_coords = gdk_window_x11_get_root_coords;
impl_class->get_device_state = gdk_window_x11_get_device_state;
impl_class->shape_combine_region = gdk_window_x11_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_x11_input_shape_combine_region;
impl_class->set_static_gravities = gdk_window_x11_set_static_gravities;
impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
impl_class->destroy = gdk_x11_window_destroy;
impl_class->destroy_foreign = gdk_x11_window_destroy_foreign;
impl_class->get_shape = gdk_x11_window_get_shape;
impl_class->get_input_shape = gdk_x11_window_get_input_shape;
impl_class->beep = gdk_x11_window_beep;
impl_class->focus = gdk_x11_window_focus;
impl_class->set_type_hint = gdk_x11_window_set_type_hint;
impl_class->get_type_hint = gdk_x11_window_get_type_hint;
impl_class->set_modal_hint = gdk_x11_window_set_modal_hint;
impl_class->set_skip_taskbar_hint = gdk_x11_window_set_skip_taskbar_hint;
impl_class->set_skip_pager_hint = gdk_x11_window_set_skip_pager_hint;
impl_class->set_urgency_hint = gdk_x11_window_set_urgency_hint;
impl_class->set_geometry_hints = gdk_x11_window_set_geometry_hints;
impl_class->set_title = gdk_x11_window_set_title;
impl_class->set_role = gdk_x11_window_set_role;
impl_class->set_startup_id = gdk_x11_window_set_startup_id;
impl_class->set_transient_for = gdk_x11_window_set_transient_for;
impl_class->get_frame_extents = gdk_x11_window_get_frame_extents;
impl_class->set_override_redirect = gdk_x11_window_set_override_redirect;
impl_class->set_accept_focus = gdk_x11_window_set_accept_focus;
impl_class->set_focus_on_map = gdk_x11_window_set_focus_on_map;
impl_class->set_icon_list = gdk_x11_window_set_icon_list;
impl_class->set_icon_name = gdk_x11_window_set_icon_name;
impl_class->iconify = gdk_x11_window_iconify;
impl_class->deiconify = gdk_x11_window_deiconify;
impl_class->stick = gdk_x11_window_stick;
impl_class->unstick = gdk_x11_window_unstick;
impl_class->maximize = gdk_x11_window_maximize;
impl_class->unmaximize = gdk_x11_window_unmaximize;
impl_class->fullscreen = gdk_x11_window_fullscreen;
impl_class->apply_fullscreen_mode = gdk_x11_window_apply_fullscreen_mode;
impl_class->unfullscreen = gdk_x11_window_unfullscreen;
impl_class->set_keep_above = gdk_x11_window_set_keep_above;
impl_class->set_keep_below = gdk_x11_window_set_keep_below;
impl_class->get_group = gdk_x11_window_get_group;
impl_class->set_group = gdk_x11_window_set_group;
impl_class->set_decorations = gdk_x11_window_set_decorations;
impl_class->get_decorations = gdk_x11_window_get_decorations;
impl_class->set_functions = gdk_x11_window_set_functions;
impl_class->set_functions = gdk_x11_window_set_functions;
impl_class->begin_resize_drag = gdk_x11_window_begin_resize_drag;
impl_class->begin_move_drag = gdk_x11_window_begin_move_drag;
impl_class->set_opacity = gdk_x11_window_set_opacity;
impl_class->set_composited = gdk_x11_window_set_composited;
impl_class->destroy_notify = gdk_x11_window_destroy_notify;
impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol;
impl_class->register_dnd = _gdk_x11_window_register_dnd;
impl_class->drag_begin = _gdk_x11_window_drag_begin;
2010-12-16 06:21:49 +00:00
impl_class->sync_rendering = _gdk_x11_window_sync_rendering;
impl_class->simulate_key = _gdk_x11_window_simulate_key;
impl_class->simulate_button = _gdk_x11_window_simulate_button;
impl_class->get_property = _gdk_x11_window_get_property;
impl_class->change_property = _gdk_x11_window_change_property;
impl_class->delete_property = _gdk_x11_window_delete_property;
impl_class->get_scale_factor = gdk_x11_window_get_scale_factor;
impl_class->set_opaque_region = gdk_x11_window_set_opaque_region;
impl_class->set_shadow_width = gdk_x11_window_set_shadow_width;
impl_class->show_window_menu = gdk_x11_window_show_window_menu;
}