1997-11-24 22:37:52 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
2007-07-19 23:50:39 +00:00
|
|
|
* 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
|
2000-07-26 11:33:08 +00:00
|
|
|
* 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
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +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
|
|
|
*/
|
1998-03-17 07:54:57 +00:00
|
|
|
|
1999-02-24 07:37:18 +00:00
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* 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/.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2004-03-06 03:38:59 +00:00
|
|
|
|
2010-10-15 02:05:51 +00:00
|
|
|
#include "gdkwindow-x11.h"
|
2004-08-09 20:14:43 +00:00
|
|
|
|
1999-10-01 23:18:30 +00:00
|
|
|
#include "gdkwindow.h"
|
2008-06-27 14:27:44 +00:00
|
|
|
#include "gdkwindowimpl.h"
|
2010-12-11 05:14:53 +00:00
|
|
|
#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"
|
2010-12-16 03:09:35 +00:00
|
|
|
#include "gdkasync.h"
|
2010-05-25 22:38:44 +00:00
|
|
|
#include "gdkeventsource.h"
|
2010-12-16 03:09:35 +00:00
|
|
|
#include "gdkdisplay-x11.h"
|
2012-10-03 23:42:13 +00:00
|
|
|
#include "gdkframeclockidle.h"
|
2010-12-16 03:09:35 +00:00
|
|
|
#include "gdkprivate-x11.h"
|
1998-12-24 19:39:00 +00:00
|
|
|
|
[ 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>
|
2010-10-15 02:05:51 +00:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <cairo-xlib.h>
|
|
|
|
|
|
|
|
#include "MwmUtil.h"
|
1998-12-24 19:39:00 +00:00
|
|
|
|
2010-10-15 02:05:51 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <X11/Xatom.h>
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-03 22:41:32 +00:00
|
|
|
#include <X11/extensions/shape.h>
|
|
|
|
|
2010-10-15 02:05:51 +00:00
|
|
|
#ifdef HAVE_XKB
|
|
|
|
#include <X11/XKBlib.h>
|
|
|
|
#endif
|
|
|
|
|
2007-06-01 12:16:12 +00:00
|
|
|
#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
|
|
|
|
|
2010-12-15 22:32:29 +00:00
|
|
|
const int _gdk_x11_event_mask_table[21] =
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
ExposureMask,
|
|
|
|
PointerMotionMask,
|
|
|
|
PointerMotionHintMask,
|
|
|
|
ButtonMotionMask,
|
|
|
|
Button1MotionMask,
|
|
|
|
Button2MotionMask,
|
|
|
|
Button3MotionMask,
|
2000-02-18 20:02:24 +00:00
|
|
|
ButtonPressMask,
|
|
|
|
ButtonReleaseMask,
|
1997-11-24 22:37:52 +00:00
|
|
|
KeyPressMask,
|
|
|
|
KeyReleaseMask,
|
|
|
|
EnterWindowMask,
|
|
|
|
LeaveWindowMask,
|
|
|
|
FocusChangeMask,
|
|
|
|
StructureNotifyMask,
|
|
|
|
PropertyChangeMask,
|
1998-01-06 01:17:10 +00:00
|
|
|
VisibilityChangeMask,
|
2010-12-15 22:32:29 +00:00
|
|
|
0, /* PROXIMITY_IN */
|
|
|
|
0, /* PROXIMTY_OUT */
|
2000-02-18 20:02:24 +00:00
|
|
|
SubstructureNotifyMask,
|
|
|
|
ButtonPressMask /* SCROLL; on X mouse wheel events is treated as mouse button 4/5 */
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
2010-12-15 22:32:29 +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
|
|
|
|
1999-01-27 18:21:20 +00:00
|
|
|
/* Forward declarations */
|
2013-01-21 10:52:32 +00:00
|
|
|
static void gdk_x11_window_apply_fullscreen_mode (GdkWindow *window);
|
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);
|
2002-11-08 22:29:33 +00:00
|
|
|
static void set_wm_name (GdkDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
const gchar *name);
|
2006-05-25 05:30:14 +00:00
|
|
|
static void move_to_current_desktop (GdkWindow *window);
|
2010-08-15 11:49:30 +00:00
|
|
|
static void gdk_window_x11_set_background (GdkWindow *window,
|
|
|
|
cairo_pattern_t *pattern);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void gdk_window_impl_x11_finalize (GObject *object);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
2009-08-07 16:00:10 +00:00
|
|
|
#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
|
|
|
|
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
|
|
|
GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
#define WINDOW_IS_TOPLEVEL(window) \
|
|
|
|
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
|
|
|
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN && \
|
|
|
|
GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
|
2003-12-21 16:37:43 +00:00
|
|
|
|
2004-08-23 17:10:34 +00:00
|
|
|
/* 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 )) \
|
|
|
|
)
|
|
|
|
|
2010-12-21 02:34:31 +00:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-22 19:42:00 +00:00
|
|
|
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)
|
2002-09-25 19:16:46 +00:00
|
|
|
{
|
2003-12-21 16:37:43 +00:00
|
|
|
impl->toplevel_window_type = -1;
|
2010-12-20 02:12:33 +00:00
|
|
|
impl->device_cursor = g_hash_table_new_full (NULL, NULL,
|
|
|
|
NULL, g_object_unref);
|
1998-03-07 18:38:18 +00:00
|
|
|
}
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
GdkToplevelX11 *
|
|
|
|
_gdk_x11_window_get_toplevel (GdkWindow *window)
|
|
|
|
{
|
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
|
|
|
|
|
2008-05-25 23:27:34 +00:00
|
|
|
if (!WINDOW_IS_TOPLEVEL (window))
|
2003-07-05 02:34:52 +00:00
|
|
|
return NULL;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2003-07-05 02:34:52 +00:00
|
|
|
|
|
|
|
if (!impl->toplevel)
|
2012-03-31 14:01:36 +00:00
|
|
|
{
|
|
|
|
impl->toplevel = g_new0 (GdkToplevelX11, 1);
|
|
|
|
impl->toplevel->have_focused = TRUE;
|
|
|
|
}
|
2003-07-05 02:34:52 +00:00
|
|
|
|
|
|
|
return impl->toplevel;
|
|
|
|
}
|
|
|
|
|
2010-10-06 01:49:04 +00:00
|
|
|
static const cairo_user_data_key_t gdk_x11_cairo_key;
|
|
|
|
|
|
|
|
/**
|
2010-10-06 02:03:23 +00:00
|
|
|
* _gdk_x11_window_update_size:
|
|
|
|
* @impl: a #GdkWindowImplX11.
|
2010-10-06 01:49:04 +00:00
|
|
|
*
|
2010-10-06 02:03:23 +00:00
|
|
|
* Updates the state of the window (in particular the drawable's
|
2010-10-06 01:49:04 +00:00
|
|
|
* cairo surface) when its size has changed.
|
|
|
|
**/
|
|
|
|
void
|
2010-10-06 02:03:23 +00:00
|
|
|
_gdk_x11_window_update_size (GdkWindowImplX11 *impl)
|
2010-10-06 01:49:04 +00:00
|
|
|
{
|
|
|
|
if (impl->cairo_surface)
|
|
|
|
{
|
|
|
|
cairo_xlib_surface_set_size (impl->cairo_surface,
|
|
|
|
gdk_window_get_width (impl->wrapper),
|
|
|
|
gdk_window_get_height (impl->wrapper));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-18 13:31:17 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2012-11-14 17:23:41 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2012-11-15 19:11:41 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_predict_presentation_time (GdkWindow *window)
|
|
|
|
{
|
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
|
|
|
GdkFrameClock *clock;
|
|
|
|
GdkFrameTimings *timings;
|
|
|
|
gint64 frame_time;
|
|
|
|
gint64 presentation_time;
|
|
|
|
gint64 refresh_interval;
|
|
|
|
gboolean slept_before;
|
|
|
|
|
|
|
|
if (!WINDOW_IS_TOPLEVEL (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
clock = gdk_window_get_frame_clock (window);
|
|
|
|
|
|
|
|
timings = gdk_frame_clock_get_current_frame_timings (clock);
|
|
|
|
frame_time = gdk_frame_timings_get_frame_time (timings);
|
|
|
|
slept_before = gdk_frame_timings_get_slept_before (timings);
|
|
|
|
|
|
|
|
gdk_frame_clock_get_refresh_info (clock,
|
|
|
|
frame_time,
|
|
|
|
&refresh_interval, &presentation_time);
|
|
|
|
|
|
|
|
if (presentation_time != 0)
|
|
|
|
{
|
|
|
|
if (slept_before)
|
|
|
|
{
|
|
|
|
presentation_time += refresh_interval;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (presentation_time < frame_time + refresh_interval / 2)
|
|
|
|
presentation_time += refresh_interval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (slept_before)
|
|
|
|
presentation_time = frame_time + refresh_interval + refresh_interval / 2;
|
|
|
|
else
|
|
|
|
presentation_time = frame_time + refresh_interval;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (presentation_time < impl->toplevel->throttled_presentation_time)
|
|
|
|
presentation_time = impl->toplevel->throttled_presentation_time;
|
|
|
|
|
|
|
|
gdk_frame_timings_set_predicted_presentation_time (timings,
|
|
|
|
presentation_time);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-09-18 13:37:03 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_begin_frame (GdkWindow *window)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
|
2012-11-14 17:23:41 +00:00
|
|
|
impl->toplevel->in_frame = TRUE;
|
|
|
|
|
|
|
|
hook_surface_changed (window);
|
2012-09-18 13:37:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_x11_window_end_frame (GdkWindow *window)
|
|
|
|
{
|
2012-11-14 21:50:05 +00:00
|
|
|
GdkFrameClock *clock;
|
|
|
|
GdkFrameTimings *timings;
|
2012-09-18 13:37:03 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
|
|
|
|
|
|
|
if (!WINDOW_IS_TOPLEVEL (window) ||
|
2012-11-14 17:23:41 +00:00
|
|
|
impl->toplevel->extended_update_counter == None ||
|
|
|
|
!impl->toplevel->in_frame)
|
2012-09-18 13:37:03 +00:00
|
|
|
return;
|
|
|
|
|
2012-11-14 21:50:05 +00:00
|
|
|
clock = gdk_window_get_frame_clock (window);
|
2012-11-15 19:11:41 +00:00
|
|
|
timings = gdk_frame_clock_get_current_frame_timings (clock);
|
2012-11-14 21:50:05 +00:00
|
|
|
|
2012-11-14 17:23:41 +00:00
|
|
|
impl->toplevel->in_frame = FALSE;
|
|
|
|
|
2012-10-04 00:15:44 +00:00
|
|
|
if (impl->toplevel->current_counter_value % 2 == 1)
|
2012-09-18 13:37:03 +00:00
|
|
|
{
|
2012-11-15 00:21:33 +00:00
|
|
|
#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 */
|
|
|
|
|
2012-11-14 21:50:05 +00:00
|
|
|
/* 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 (gdk_frame_timings_get_slept_before (timings))
|
|
|
|
impl->toplevel->current_counter_value += 3;
|
|
|
|
else
|
|
|
|
impl->toplevel->current_counter_value += 1;
|
|
|
|
|
2012-10-04 00:15:44 +00:00
|
|
|
set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
|
|
|
|
impl->toplevel->extended_update_counter,
|
|
|
|
impl->toplevel->current_counter_value);
|
|
|
|
|
|
|
|
if (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));
|
2012-11-14 21:50:05 +00:00
|
|
|
gdk_frame_timings_set_cookie (timings,
|
|
|
|
impl->toplevel->current_counter_value);
|
2012-10-04 00:15:44 +00:00
|
|
|
}
|
2012-09-18 13:37:03 +00:00
|
|
|
}
|
2012-11-14 17:23:41 +00:00
|
|
|
|
|
|
|
unhook_surface_changed (window);
|
2012-11-14 21:50:05 +00:00
|
|
|
|
|
|
|
if (!impl->toplevel->frame_pending)
|
|
|
|
gdk_frame_timings_set_complete (timings, TRUE);
|
2012-09-18 13:37:03 +00:00
|
|
|
}
|
|
|
|
|
2010-10-06 01:49:04 +00:00
|
|
|
/*****************************************************
|
|
|
|
* 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 *
|
2010-11-23 00:46:03 +00:00
|
|
|
gdk_x11_create_cairo_surface (GdkWindowImplX11 *impl,
|
2010-10-06 01:49:04 +00:00
|
|
|
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 *
|
2010-11-23 00:46:03 +00:00
|
|
|
gdk_x11_ref_cairo_surface (GdkWindow *window)
|
2010-10-06 01:49:04 +00:00
|
|
|
{
|
2010-11-23 00:46:03 +00:00
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2010-10-06 01:49:04 +00:00
|
|
|
|
2010-11-23 00:46:03 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
2010-10-06 01:49:04 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (!impl->cairo_surface)
|
|
|
|
{
|
2010-11-23 00:46:03 +00:00
|
|
|
impl->cairo_surface = gdk_x11_create_cairo_surface (impl,
|
|
|
|
gdk_window_get_width (window),
|
|
|
|
gdk_window_get_height (window));
|
2010-10-06 01:49:04 +00:00
|
|
|
|
|
|
|
if (impl->cairo_surface)
|
|
|
|
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
|
2010-11-23 00:46:03 +00:00
|
|
|
impl, gdk_x11_cairo_surface_destroy);
|
2012-11-14 17:23:41 +00:00
|
|
|
|
|
|
|
if (WINDOW_IS_TOPLEVEL (window) && impl->toplevel->in_frame)
|
|
|
|
hook_surface_changed (window);
|
2010-10-06 01:49:04 +00:00
|
|
|
}
|
|
|
|
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)
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindow *wrapper;
|
2010-10-06 01:49:04 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
2010-12-15 22:45:05 +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
|
|
|
g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (object));
|
|
|
|
|
2010-10-06 01:49:04 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (object);
|
2010-12-15 22:45:05 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
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
|
|
|
|
2012-11-14 17:23:41 +00:00
|
|
|
if (WINDOW_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame)
|
|
|
|
unhook_surface_changed (wrapper);
|
|
|
|
|
2010-12-15 22:45:05 +00:00
|
|
|
_gdk_x11_window_grab_check_destroy (wrapper);
|
2002-03-02 20:37:07 +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 (wrapper))
|
1999-02-10 08:06:30 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkDisplay *display = GDK_WINDOW_DISPLAY (wrapper);
|
2010-12-15 22:45:05 +00:00
|
|
|
|
2010-12-16 04:35:15 +00:00
|
|
|
_gdk_x11_display_remove_window (display, impl->xid);
|
2010-10-06 01:49:04 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2010-10-06 01:49:04 +00:00
|
|
|
g_free (impl->toplevel);
|
2003-07-05 02:34:52 +00:00
|
|
|
|
2010-10-06 01:49:04 +00:00
|
|
|
if (impl->cursor)
|
2011-10-15 12:35:28 +00:00
|
|
|
g_object_unref (impl->cursor);
|
2005-06-15 18:37:18 +00:00
|
|
|
|
2010-10-06 01:49:04 +00:00
|
|
|
g_hash_table_destroy (impl->device_cursor);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2006-04-04 14:02:03 +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
|
|
|
|
2010-08-27 10:08:30 +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.
|
|
|
|
*/
|
2010-08-27 13:09:49 +00:00
|
|
|
cairo_surface_t *
|
|
|
|
_gdk_x11_window_create_bitmap_surface (GdkWindow *window,
|
|
|
|
int width,
|
|
|
|
int height)
|
2010-08-27 10:08:30 +00:00
|
|
|
{
|
|
|
|
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,
|
2010-12-21 01:32:13 +00:00
|
|
|
GDK_X11_SCREEN (GDK_WINDOW_SCREEN (window))->xscreen,
|
2010-08-27 10:08:30 +00:00
|
|
|
width, height);
|
|
|
|
attach_free_pixmap_handler (surface, GDK_WINDOW_DISPLAY (window), pixmap);
|
|
|
|
|
|
|
|
return surface;
|
|
|
|
}
|
|
|
|
|
2010-11-14 14:38:32 +00:00
|
|
|
/* Create a surface backed with a pixmap without alpha on the same screen as window */
|
2010-08-27 10:08:30 +00:00
|
|
|
static cairo_surface_t *
|
|
|
|
gdk_x11_window_create_pixmap_surface (GdkWindow *window,
|
|
|
|
int width,
|
|
|
|
int height)
|
|
|
|
{
|
2010-11-14 14:38:32 +00:00
|
|
|
GdkScreen *screen = gdk_window_get_screen (window);
|
|
|
|
GdkVisual *visual = gdk_screen_get_system_visual (screen);
|
2010-08-27 10:08:30 +00:00
|
|
|
cairo_surface_t *surface;
|
|
|
|
Pixmap pixmap;
|
|
|
|
|
|
|
|
pixmap = XCreatePixmap (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
width, height,
|
2010-11-13 00:19:48 +00:00
|
|
|
gdk_visual_get_depth (visual));
|
2010-08-27 10:08:30 +00:00
|
|
|
surface = cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
pixmap,
|
2010-11-13 00:19:48 +00:00
|
|
|
GDK_VISUAL_XVISUAL (visual),
|
2010-08-27 10:08:30 +00:00
|
|
|
width, height);
|
|
|
|
attach_free_pixmap_handler (surface, GDK_WINDOW_DISPLAY (window), pixmap);
|
|
|
|
|
|
|
|
return surface;
|
|
|
|
}
|
|
|
|
|
2004-07-09 22:44:35 +00:00
|
|
|
static void
|
|
|
|
tmp_unset_bg (GdkWindow *window)
|
|
|
|
{
|
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2004-07-09 22:44:35 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
impl->no_bg = TRUE;
|
2004-07-09 22:44:35 +00:00
|
|
|
|
2010-10-05 23:22:45 +00:00
|
|
|
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window), None);
|
2004-07-09 22:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
tmp_reset_bg (GdkWindow *window)
|
|
|
|
{
|
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2004-07-09 22:44:35 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
impl->no_bg = FALSE;
|
2004-07-09 22:44:35 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
gdk_window_x11_set_background (window, window->background);
|
2004-07-09 22:44:35 +00:00
|
|
|
}
|
|
|
|
|
2006-05-15 19:17:30 +00:00
|
|
|
/* 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.
|
|
|
|
*/
|
2004-07-09 22:44:35 +00:00
|
|
|
void
|
|
|
|
_gdk_x11_window_tmp_unset_bg (GdkWindow *window,
|
|
|
|
gboolean recurse)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->input_only || window->destroyed ||
|
|
|
|
(window->window_type != GDK_WINDOW_ROOT &&
|
2008-12-18 12:36:52 +00:00
|
|
|
!GDK_WINDOW_IS_MAPPED (window)))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (_gdk_window_has_impl (window) &&
|
|
|
|
GDK_WINDOW_IS_X11 (window) &&
|
2010-11-22 23:55:39 +00:00
|
|
|
window->window_type != GDK_WINDOW_ROOT &&
|
|
|
|
window->window_type != GDK_WINDOW_FOREIGN)
|
2008-12-18 12:36:52 +00:00
|
|
|
tmp_unset_bg (window);
|
2004-07-09 22:44:35 +00:00
|
|
|
|
|
|
|
if (recurse)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
for (l = window->children; l != NULL; l = l->next)
|
2004-07-09 22:44:35 +00:00
|
|
|
_gdk_x11_window_tmp_unset_bg (l->data, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-20 20:59:04 +00:00
|
|
|
void
|
2009-01-27 15:43:03 +00:00
|
|
|
_gdk_x11_window_tmp_unset_parent_bg (GdkWindow *window)
|
2009-01-20 20:59:04 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT)
|
2009-01-27 15:43:03 +00:00
|
|
|
return;
|
2009-01-20 22:31:51 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window = _gdk_window_get_impl_window (window->parent);
|
2009-01-27 15:43:03 +00:00
|
|
|
_gdk_x11_window_tmp_unset_bg (window, FALSE);
|
2009-01-20 20:59:04 +00:00
|
|
|
}
|
|
|
|
|
2004-07-09 22:44:35 +00:00
|
|
|
void
|
|
|
|
_gdk_x11_window_tmp_reset_bg (GdkWindow *window,
|
|
|
|
gboolean recurse)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->input_only || window->destroyed ||
|
|
|
|
(window->window_type != GDK_WINDOW_ROOT &&
|
2008-12-18 12:36:52 +00:00
|
|
|
!GDK_WINDOW_IS_MAPPED (window)))
|
|
|
|
return;
|
2004-07-09 22:44:35 +00:00
|
|
|
|
2008-12-18 12:36:52 +00:00
|
|
|
|
|
|
|
if (_gdk_window_has_impl (window) &&
|
|
|
|
GDK_WINDOW_IS_X11 (window) &&
|
2010-11-22 23:55:39 +00:00
|
|
|
window->window_type != GDK_WINDOW_ROOT &&
|
|
|
|
window->window_type != GDK_WINDOW_FOREIGN)
|
2008-12-18 12:36:52 +00:00
|
|
|
tmp_reset_bg (window);
|
2004-07-09 22:44:35 +00:00
|
|
|
|
|
|
|
if (recurse)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
for (l = window->children; l != NULL; l = l->next)
|
2004-07-09 22:44:35 +00:00
|
|
|
_gdk_x11_window_tmp_reset_bg (l->data, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-20 20:59:04 +00:00
|
|
|
void
|
2009-01-27 15:43:03 +00:00
|
|
|
_gdk_x11_window_tmp_reset_parent_bg (GdkWindow *window)
|
2009-01-20 20:59:04 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT)
|
2009-01-27 15:43:03 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window = _gdk_window_get_impl_window (window->parent);
|
2009-01-20 22:31:51 +00:00
|
|
|
|
2009-01-27 15:43:03 +00:00
|
|
|
_gdk_x11_window_tmp_reset_bg (window, FALSE);
|
2009-01-20 20:59:04 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
2010-12-15 19:49:23 +00:00
|
|
|
_gdk_x11_screen_init_root_window (GdkScreen *screen)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindow *window;
|
2010-10-06 01:49:04 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
2010-12-21 01:32:13 +00:00
|
|
|
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
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
x11_screen = GDK_X11_SCREEN (screen);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
g_assert (x11_screen->root_window == NULL);
|
1999-11-08 20:14:59 +00:00
|
|
|
|
2010-12-21 02:06:59 +00:00
|
|
|
window = x11_screen->root_window = _gdk_display_create_window (gdk_screen_get_display (screen));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-11-23 00:03:55 +00:00
|
|
|
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
|
2010-11-22 23:55:39 +00:00
|
|
|
window->impl_window = window;
|
|
|
|
window->visual = gdk_screen_get_system_visual (screen);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
1999-11-08 20:14:59 +00:00
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
impl->xid = x11_screen->xroot_window;
|
2010-11-22 23:55:39 +00:00
|
|
|
impl->wrapper = 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
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window->window_type = GDK_WINDOW_ROOT;
|
2010-12-21 01:32:13 +00:00
|
|
|
window->depth = DefaultDepthOfScreen (x11_screen->xscreen);
|
2002-09-27 22:57:29 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window->x = 0;
|
|
|
|
window->y = 0;
|
|
|
|
window->abs_x = 0;
|
|
|
|
window->abs_y = 0;
|
2010-12-21 01:32:13 +00:00
|
|
|
window->width = WidthOfScreen (x11_screen->xscreen);
|
|
|
|
window->height = HeightOfScreen (x11_screen->xscreen);
|
2010-11-22 23:55:39 +00:00
|
|
|
window->viewable = TRUE;
|
2009-09-06 06:42:39 +00:00
|
|
|
|
|
|
|
/* see init_randr_support() in gdkscreen-x11.c */
|
2010-11-22 23:55:39 +00:00
|
|
|
window->event_mask = GDK_STRUCTURE_MASK;
|
2009-09-06 06:42:39 +00:00
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
_gdk_window_update_size (x11_screen->root_window);
|
2010-12-16 04:35:15 +00:00
|
|
|
|
2010-12-21 01:32:13 +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
|
|
|
}
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
static void
|
|
|
|
set_wm_protocols (GdkWindow *window)
|
|
|
|
{
|
2010-08-29 00:08:47 +00:00
|
|
|
GdkDisplay *display = gdk_window_get_display (window);
|
2004-07-11 13:26:57 +00:00
|
|
|
Atom protocols[4];
|
|
|
|
int n = 0;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
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");
|
|
|
|
protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PING");
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2004-07-11 13:26:57 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
2010-12-20 18:20:10 +00:00
|
|
|
if (GDK_X11_DISPLAY (display)->use_sync)
|
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);
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
1999-01-17 22:58:59 +00:00
|
|
|
|
2002-11-08 22:29:33 +00:00
|
|
|
static const gchar *
|
|
|
|
get_default_title (void)
|
|
|
|
{
|
|
|
|
const char *title;
|
|
|
|
|
|
|
|
title = g_get_application_name ();
|
|
|
|
if (!title)
|
|
|
|
title = g_get_prgname ();
|
2007-12-28 15:51:31 +00:00
|
|
|
if (!title)
|
|
|
|
title = "";
|
2002-11-08 22:29:33 +00:00
|
|
|
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
check_leader_window_title (GdkDisplay *display)
|
|
|
|
{
|
2010-12-20 18:20:10 +00:00
|
|
|
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
2002-11-08 22:29:33 +00:00
|
|
|
|
2003-12-09 23:12:53 +00:00
|
|
|
if (display_x11->leader_window && !display_x11->leader_window_title_set)
|
2002-11-08 22:29:33 +00:00
|
|
|
{
|
|
|
|
set_wm_name (display,
|
|
|
|
display_x11->leader_window,
|
|
|
|
get_default_title ());
|
|
|
|
|
|
|
|
display_x11->leader_window_title_set = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-12-21 16:37:43 +00:00
|
|
|
static Window
|
2010-05-25 22:38:44 +00:00
|
|
|
create_focus_window (GdkDisplay *display,
|
|
|
|
XID parent)
|
2003-12-21 16:37:43 +00:00
|
|
|
{
|
2010-12-20 16:14:04 +00:00
|
|
|
GdkX11Display *display_x11;
|
2010-05-25 22:38:44 +00:00
|
|
|
GdkEventMask event_mask;
|
|
|
|
Display *xdisplay;
|
|
|
|
Window focus_window;
|
|
|
|
|
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
2010-12-20 18:20:10 +00:00
|
|
|
display_x11 = GDK_X11_DISPLAY (display);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
focus_window = XCreateSimpleWindow (xdisplay, parent,
|
|
|
|
-1, -1, 1, 1, 0,
|
|
|
|
0, 0);
|
|
|
|
|
2003-12-21 16:37:43 +00:00
|
|
|
/* FIXME: probably better to actually track the requested event mask for the toplevel
|
|
|
|
*/
|
2010-05-25 22:38:44 +00:00
|
|
|
event_mask = (GDK_KEY_PRESS_MASK |
|
|
|
|
GDK_KEY_RELEASE_MASK |
|
|
|
|
GDK_FOCUS_CHANGE_MASK);
|
|
|
|
|
2010-12-15 17:25:38 +00:00
|
|
|
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
|
|
|
|
focus_window,
|
|
|
|
event_mask, 0);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2003-12-21 16:37:43 +00:00
|
|
|
XMapWindow (xdisplay, focus_window);
|
|
|
|
|
|
|
|
return focus_window;
|
|
|
|
}
|
|
|
|
|
2004-08-02 20:01:27 +00:00
|
|
|
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);
|
|
|
|
|
2012-09-18 13:37:03 +00:00
|
|
|
if (toplevel &&
|
2004-08-02 20:01:27 +00:00
|
|
|
toplevel->update_counter == None &&
|
2010-12-20 18:20:10 +00:00
|
|
|
GDK_X11_DISPLAY (display)->use_sync)
|
2004-08-02 20:01:27 +00:00
|
|
|
{
|
|
|
|
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
XSyncValue value;
|
|
|
|
Atom atom;
|
2012-09-18 13:31:17 +00:00
|
|
|
XID counters[2];
|
2004-08-02 20:01:27 +00:00
|
|
|
|
|
|
|
XSyncIntToValue (&value, 0);
|
|
|
|
|
|
|
|
toplevel->update_counter = XSyncCreateCounter (xdisplay, value);
|
2012-09-18 13:31:17 +00:00
|
|
|
toplevel->extended_update_counter = XSyncCreateCounter (xdisplay, value);
|
2004-08-02 20:01:27 +00:00
|
|
|
|
|
|
|
atom = gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
"_NET_WM_SYNC_REQUEST_COUNTER");
|
2012-09-18 13:31:17 +00:00
|
|
|
|
|
|
|
counters[0] = toplevel->update_counter;
|
|
|
|
counters[1] = toplevel->extended_update_counter;
|
2004-08-02 20:01:27 +00:00
|
|
|
XChangeProperty (xdisplay, GDK_WINDOW_XID (window),
|
|
|
|
atom, XA_CARDINAL,
|
|
|
|
32, PropModeReplace,
|
2012-09-18 13:31:17 +00:00
|
|
|
(guchar *)counters, 2);
|
2004-08-02 20:01:27 +00:00
|
|
|
|
2012-09-18 13:31:17 +00:00
|
|
|
toplevel->current_counter_value = 0;
|
2004-08-02 20:01:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2003-12-21 16:37:43 +00:00
|
|
|
static void
|
2004-07-11 13:26:57 +00:00
|
|
|
setup_toplevel_window (GdkWindow *window,
|
|
|
|
GdkWindow *parent)
|
2003-12-21 16:37:43 +00:00
|
|
|
{
|
|
|
|
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
|
2010-08-29 00:08:47 +00:00
|
|
|
GdkDisplay *display = gdk_window_get_display (window);
|
2003-12-21 16:37:43 +00:00
|
|
|
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
|
|
|
|
XID xid = GDK_WINDOW_XID (window);
|
2010-12-21 01:32:13 +00:00
|
|
|
GdkX11Screen *x11_screen = GDK_X11_SCREEN (GDK_WINDOW_SCREEN (parent));
|
2003-12-21 16:37:43 +00:00
|
|
|
XSizeHints size_hints;
|
|
|
|
long pid;
|
2007-05-02 00:02:14 +00:00
|
|
|
Window leader_window;
|
2010-08-29 00:10:02 +00:00
|
|
|
|
2003-12-21 16:37:43 +00:00
|
|
|
set_wm_protocols (window);
|
2010-08-29 00:10:02 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (!window->input_only)
|
2003-12-21 16:37:43 +00:00
|
|
|
{
|
|
|
|
/* 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);
|
2010-12-21 01:32:13 +00:00
|
|
|
_gdk_x11_display_add_window (x11_screen->display,
|
2010-12-16 04:35:15 +00:00
|
|
|
&toplevel->focus_window,
|
|
|
|
window);
|
2003-12-21 16:37:43 +00:00
|
|
|
}
|
2010-12-16 04:35:15 +00:00
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
check_leader_window_title (x11_screen->display);
|
2010-12-16 04:35:15 +00:00
|
|
|
|
2003-12-21 16:37:43 +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;
|
2010-11-22 23:55:39 +00:00
|
|
|
size_hints.width = window->width;
|
|
|
|
size_hints.height = window->height;
|
2003-12-21 16:37:43 +00:00
|
|
|
|
|
|
|
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,
|
2010-12-21 01:32:13 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_PID"),
|
2003-12-21 16:37:43 +00:00
|
|
|
XA_CARDINAL, 32,
|
|
|
|
PropModeReplace,
|
|
|
|
(guchar *)&pid, 1);
|
2007-05-02 00:02:14 +00:00
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
leader_window = GDK_X11_DISPLAY (x11_screen->display)->leader_window;
|
2007-05-02 00:02:14 +00:00
|
|
|
if (!leader_window)
|
|
|
|
leader_window = xid;
|
2003-12-21 16:37:43 +00:00
|
|
|
XChangeProperty (xdisplay, xid,
|
2010-12-21 01:32:13 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "WM_CLIENT_LEADER"),
|
2003-12-21 16:37:43 +00:00
|
|
|
XA_WINDOW, 32, PropModeReplace,
|
2007-05-02 00:02:14 +00:00
|
|
|
(guchar *) &leader_window, 1);
|
2004-04-18 14:33:07 +00:00
|
|
|
|
2007-04-01 03:38:34 +00:00
|
|
|
if (toplevel->focus_window != None)
|
|
|
|
XChangeProperty (xdisplay, xid,
|
2010-12-21 01:32:13 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_USER_TIME_WINDOW"),
|
2007-04-01 03:38:34 +00:00
|
|
|
XA_WINDOW, 32, PropModeReplace,
|
|
|
|
(guchar *) &toplevel->focus_window, 1);
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (!window->focus_on_map)
|
2004-07-07 02:59:47 +00:00
|
|
|
gdk_x11_window_set_user_time (window, 0);
|
2010-12-21 01:32:13 +00:00
|
|
|
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);
|
2004-08-02 20:01:27 +00:00
|
|
|
|
|
|
|
ensure_sync_counter (window);
|
2012-10-04 00:15:44 +00:00
|
|
|
|
|
|
|
/* Start off in a frozen state - we'll finish this when we first paint */
|
|
|
|
gdk_x11_window_begin_frame (window);
|
2003-12-21 16:37:43 +00:00
|
|
|
}
|
|
|
|
|
2012-09-18 13:37:03 +00:00
|
|
|
static void
|
|
|
|
on_frame_clock_before_paint (GdkFrameClock *clock,
|
|
|
|
GdkWindow *window)
|
|
|
|
{
|
2012-11-15 19:11:41 +00:00
|
|
|
gdk_x11_window_predict_presentation_time (window);
|
2012-09-18 13:37:03 +00:00
|
|
|
gdk_x11_window_begin_frame (window);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
on_frame_clock_after_paint (GdkFrameClock *clock,
|
|
|
|
GdkWindow *window)
|
|
|
|
{
|
|
|
|
gdk_x11_window_end_frame (window);
|
2012-11-14 17:49:06 +00:00
|
|
|
|
2012-09-18 13:37:03 +00:00
|
|
|
}
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
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;
|
2010-12-21 01:32:13 +00:00
|
|
|
GdkX11Screen *x11_screen;
|
2010-12-20 16:14:04 +00:00
|
|
|
GdkX11Display *display_x11;
|
2012-10-03 23:42:13 +00:00
|
|
|
GdkFrameClock *clock;
|
2010-12-16 00:07:36 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
Window xparent;
|
|
|
|
Visual *xvisual;
|
2001-04-18 17:57:36 +00:00
|
|
|
Display *xdisplay;
|
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;
|
2002-11-08 22:29:33 +00:00
|
|
|
const char *title;
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2010-12-20 18:20:10 +00:00
|
|
|
display_x11 = GDK_X11_DISPLAY (display);
|
2008-12-03 21:00:56 +00:00
|
|
|
xparent = GDK_WINDOW_XID (real_parent);
|
2010-12-21 01:32:13 +00:00
|
|
|
x11_screen = GDK_X11_SCREEN (screen);
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2010-11-23 00:03:55 +00:00
|
|
|
impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
|
2010-11-24 13:36:45 +00:00
|
|
|
window->impl = GDK_WINDOW_IMPL (impl);
|
2010-10-06 22:17:33 +00:00
|
|
|
impl->wrapper = GDK_WINDOW (window);
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
xdisplay = x11_screen->xdisplay;
|
2001-10-24 14:15:50 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
xattributes_mask = 0;
|
2006-05-25 05:30:14 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
xvisual = gdk_x11_visual_get_xvisual (window->visual);
|
2010-12-16 00:07:36 +00:00
|
|
|
|
1999-01-27 18:21:20 +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;
|
1999-01-27 18:21:20 +00:00
|
|
|
xattributes_mask |= CWOverrideRedirect;
|
2010-12-16 00:07:36 +00:00
|
|
|
}
|
1999-01-27 18:21:20 +00:00
|
|
|
else
|
1997-12-16 22:10:43 +00:00
|
|
|
xattributes.override_redirect = False;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
2004-07-09 21:27:09 +00:00
|
|
|
impl->override_redirect = xattributes.override_redirect;
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->parent && window->parent->guffaw_gravity)
|
1999-01-27 18:21:20 +00:00
|
|
|
{
|
|
|
|
xattributes.win_gravity = StaticGravity;
|
|
|
|
xattributes_mask |= CWWinGravity;
|
|
|
|
}
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2001-07-05 02:58:34 +00:00
|
|
|
/* Sanity checks */
|
2010-11-22 23:55:39 +00:00
|
|
|
switch (window->window_type)
|
2001-07-05 02:58:34 +00:00
|
|
|
{
|
|
|
|
case GDK_WINDOW_TOPLEVEL:
|
|
|
|
case GDK_WINDOW_TEMP:
|
2010-11-22 23:55:39 +00:00
|
|
|
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);
|
|
|
|
}
|
2001-07-05 02:58:34 +00:00
|
|
|
}
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (!window->input_only)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
class = InputOutput;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
2010-12-21 01:32:13 +00:00
|
|
|
xattributes.background_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
2010-12-21 01:32:13 +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
|
|
|
|
2010-11-22 23:55:39 +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;
|
2001-07-05 02:58:34 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
xattributes.colormap = _gdk_visual_get_x11_colormap (window->visual);
|
2001-07-05 02:58:34 +00:00
|
|
|
xattributes_mask |= CWColormap;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
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;
|
|
|
|
}
|
1999-11-08 20:14:59 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->width > 65535 ||
|
|
|
|
window->height > 65535)
|
2009-01-22 13:10:19 +00:00
|
|
|
{
|
|
|
|
g_warning ("Native Windows wider or taller than 65535 pixels are not supported");
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->width > 65535)
|
2010-12-16 00:07:36 +00:00
|
|
|
window->width = 65535;
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->height > 65535)
|
2010-12-16 00:07:36 +00:00
|
|
|
window->height = 65535;
|
2009-01-22 13:10:19 +00:00
|
|
|
}
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2010-10-06 00:15:51 +00:00
|
|
|
impl->xid = XCreateWindow (xdisplay, xparent,
|
2010-11-22 23:55:39 +00:00
|
|
|
window->x + window->parent->abs_x,
|
|
|
|
window->y + window->parent->abs_y,
|
|
|
|
window->width, window->height,
|
|
|
|
0, window->depth, class, xvisual,
|
2010-10-06 00:15:51 +00:00
|
|
|
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
|
|
|
|
2002-09-25 07:23:55 +00:00
|
|
|
g_object_ref (window);
|
2010-12-21 01:32:13 +00:00
|
|
|
_gdk_x11_display_add_window (x11_screen->display, &impl->xid, window);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
switch (GDK_WINDOW_TYPE (window))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
case GDK_WINDOW_TOPLEVEL:
|
|
|
|
case GDK_WINDOW_TEMP:
|
2003-12-21 16:37:43 +00:00
|
|
|
if (attributes_mask & GDK_WA_TITLE)
|
2010-12-16 00:07:36 +00:00
|
|
|
title = attributes->title;
|
2003-12-21 16:37:43 +00:00
|
|
|
else
|
2010-12-16 00:07:36 +00:00
|
|
|
title = get_default_title ();
|
|
|
|
|
2003-12-21 16:37:43 +00:00
|
|
|
gdk_window_set_title (window, title);
|
2010-12-16 00:07:36 +00:00
|
|
|
|
2003-12-21 16:37:43 +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);
|
|
|
|
}
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
setup_toplevel_window (window, window->parent);
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
2003-12-21 16:37:43 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
case GDK_WINDOW_CHILD:
|
|
|
|
default:
|
2003-12-21 16:37:43 +00:00
|
|
|
break;
|
2001-04-18 17:57:36 +00:00
|
|
|
}
|
|
|
|
|
2007-04-25 23:44:54 +00:00
|
|
|
if (attributes_mask & GDK_WA_TYPE_HINT)
|
|
|
|
gdk_window_set_type_hint (window, attributes->type_hint);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2010-12-15 17:25:38 +00:00
|
|
|
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
|
|
|
|
GDK_WINDOW_XID (window), event_mask,
|
|
|
|
StructureNotifyMask | PropertyChangeMask);
|
2012-10-03 23:42:13 +00:00
|
|
|
|
|
|
|
clock = g_object_new (GDK_TYPE_FRAME_CLOCK_IDLE, NULL);
|
|
|
|
gdk_window_set_frame_clock (window, clock);
|
2012-09-18 13:37:03 +00:00
|
|
|
g_signal_connect (clock, "before-paint",
|
|
|
|
G_CALLBACK (on_frame_clock_before_paint), window);
|
|
|
|
g_signal_connect (clock, "after-paint",
|
|
|
|
G_CALLBACK (on_frame_clock_after_paint), window);
|
2012-10-04 00:13:42 +00:00
|
|
|
|
|
|
|
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
|
|
|
|
gdk_window_freeze_toplevel_updates_libgtk_only (window);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2002-02-28 21:09:04 +00:00
|
|
|
static GdkEventMask
|
|
|
|
x_event_mask_to_gdk_event_mask (long mask)
|
|
|
|
{
|
|
|
|
GdkEventMask event_mask = 0;
|
|
|
|
int i;
|
|
|
|
|
2010-12-15 22:32:29 +00:00
|
|
|
for (i = 0; i < _gdk_x11_event_mask_table_size; i++)
|
2002-02-28 21:09:04 +00:00
|
|
|
{
|
2010-12-15 22:32:29 +00:00
|
|
|
if (mask & _gdk_x11_event_mask_table[i])
|
2002-02-28 21:09:04 +00:00
|
|
|
event_mask |= 1 << (i + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
return event_mask;
|
|
|
|
}
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
/**
|
2010-12-15 06:39:30 +00:00
|
|
|
* gdk_x11_window_foreign_new_for_display:
|
2002-04-25 22:29:14 +00:00
|
|
|
* @display: the #GdkDisplay where the window handle comes from.
|
2010-12-15 06:39:30 +00:00
|
|
|
* @window: an XLib <type>Window</type>
|
|
|
|
*
|
2011-02-01 16:22:04 +00:00
|
|
|
* 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.
|
2010-12-15 06:39:30 +00:00
|
|
|
*
|
2004-10-05 05:40:42 +00:00
|
|
|
* This may fail if the window has been destroyed. If the window
|
2010-12-15 06:39:30 +00:00
|
|
|
* was already known to GDK, a new reference to the existing
|
2004-10-05 05:40:42 +00:00
|
|
|
* #GdkWindow is returned.
|
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup and
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
2001-10-18 20:23:17 +00:00
|
|
|
*
|
2010-11-24 19:13:09 +00:00
|
|
|
* Return value: (transfer full): a #GdkWindow wrapper for the native
|
|
|
|
* window, or %NULL if the window has been destroyed. The wrapper
|
|
|
|
* will be newly created, if one doesn't exist already.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
2010-12-17 06:48:12 +00:00
|
|
|
* Since: 2.24
|
2010-12-15 06:39:30 +00:00
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
GdkWindow *
|
2010-12-15 06:39:30 +00:00
|
|
|
gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
|
|
|
|
Window window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-28 23:05:59 +00:00
|
|
|
GdkScreen *screen;
|
2010-12-15 06:39:30 +00:00
|
|
|
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;
|
2010-12-20 16:14:04 +00:00
|
|
|
GdkX11Display *display_x11;
|
1997-11-24 22:37:52 +00:00
|
|
|
XWindowAttributes attrs;
|
1998-03-14 05:15:16 +00:00
|
|
|
Window root, parent;
|
1998-07-16 19:41:12 +00:00
|
|
|
Window *children = NULL;
|
1998-03-14 05:15:16 +00:00
|
|
|
guint nchildren;
|
1999-02-21 19:25:53 +00:00
|
|
|
gboolean result;
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
2010-12-20 18:20:10 +00:00
|
|
|
display_x11 = GDK_X11_DISPLAY (display);
|
2004-10-05 05:40:42 +00:00
|
|
|
|
2010-12-16 04:35:15 +00:00
|
|
|
if ((win = gdk_x11_window_lookup_for_display (display, window)) != NULL)
|
2010-12-15 06:39:30 +00:00
|
|
|
return g_object_ref (win);
|
2004-10-05 05:40:42 +00:00
|
|
|
|
2010-12-15 06:39:30 +00:00
|
|
|
gdk_x11_display_error_trap_push (display);
|
|
|
|
result = XGetWindowAttributes (display_x11->xdisplay, window, &attrs);
|
|
|
|
if (gdk_x11_display_error_trap_pop (display) || !result)
|
1999-02-21 19:25:53 +00:00
|
|
|
return NULL;
|
|
|
|
|
2010-12-15 06:39:30 +00:00
|
|
|
/* 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)
|
1998-07-16 19:41:12 +00:00
|
|
|
return NULL;
|
1999-11-08 20:14:59 +00:00
|
|
|
|
1998-07-04 15:31:30 +00:00
|
|
|
if (children)
|
|
|
|
XFree (children);
|
2010-12-15 06:39:30 +00:00
|
|
|
|
2010-08-28 23:05:59 +00:00
|
|
|
screen = _gdk_x11_display_screen_for_xrootwin (display, root);
|
|
|
|
|
2010-12-21 02:06:59 +00:00
|
|
|
win = _gdk_display_create_window (display);
|
2010-12-15 06:39:30 +00:00
|
|
|
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));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-12-15 06:39:30 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (win->impl);
|
|
|
|
impl->wrapper = win;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-12-16 04:35:15 +00:00
|
|
|
win->parent = gdk_x11_window_lookup_for_display (display, parent);
|
2010-12-15 06:39:30 +00:00
|
|
|
|
|
|
|
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);
|
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
|
|
|
|
2010-12-15 06:39:30 +00:00
|
|
|
impl->xid = window;
|
1999-11-08 20:14:59 +00:00
|
|
|
|
2010-12-15 06:39:30 +00:00
|
|
|
win->x = attrs.x;
|
|
|
|
win->y = attrs.y;
|
|
|
|
win->width = attrs.width;
|
|
|
|
win->height = attrs.height;
|
|
|
|
win->window_type = GDK_WINDOW_FOREIGN;
|
|
|
|
win->destroyed = FALSE;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2010-12-15 06:39:30 +00:00
|
|
|
win->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
|
2002-02-28 21:09:04 +00:00
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
if (attrs.map_state == IsUnmapped)
|
2010-12-15 06:39:30 +00:00
|
|
|
win->state = GDK_WINDOW_STATE_WITHDRAWN;
|
2001-02-27 20:40:15 +00:00
|
|
|
else
|
2010-12-15 06:39:30 +00:00
|
|
|
win->state = 0;
|
|
|
|
win->viewable = TRUE;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2010-12-15 06:39:30 +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);
|
2009-01-29 13:29:23 +00:00
|
|
|
|
|
|
|
/* Update the clip region, etc */
|
2010-12-15 06:39:30 +00:00
|
|
|
_gdk_window_update_size (win);
|
2009-07-18 18:29:50 +00:00
|
|
|
|
2010-12-15 06:39:30 +00:00
|
|
|
return win;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
static void
|
2004-07-11 13:26:57 +00:00
|
|
|
gdk_toplevel_x11_free_contents (GdkDisplay *display,
|
|
|
|
GdkToplevelX11 *toplevel)
|
2003-07-05 02:34:52 +00:00
|
|
|
{
|
|
|
|
if (toplevel->icon_pixmap)
|
|
|
|
{
|
2010-08-27 10:08:30 +00:00
|
|
|
cairo_surface_destroy (toplevel->icon_pixmap);
|
2003-07-05 02:34:52 +00:00
|
|
|
toplevel->icon_pixmap = NULL;
|
|
|
|
}
|
|
|
|
if (toplevel->icon_mask)
|
|
|
|
{
|
2010-08-27 10:08:30 +00:00
|
|
|
cairo_surface_destroy (toplevel->icon_mask);
|
2003-07-05 02:34:52 +00:00
|
|
|
toplevel->icon_mask = NULL;
|
|
|
|
}
|
|
|
|
if (toplevel->group_leader)
|
|
|
|
{
|
|
|
|
g_object_unref (toplevel->group_leader);
|
|
|
|
toplevel->group_leader = NULL;
|
|
|
|
}
|
2004-07-12 05:57:41 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
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;
|
|
|
|
|
2012-09-18 13:31:17 +00:00
|
|
|
toplevel->current_counter_value = 0;
|
2004-07-11 13:26:57 +00:00
|
|
|
}
|
2004-07-12 05:57:41 +00:00
|
|
|
#endif
|
2003-07-05 02:34:52 +00:00
|
|
|
}
|
|
|
|
|
2008-12-15 14:04:44 +00:00
|
|
|
static void
|
2010-12-10 19:06:13 +00:00
|
|
|
gdk_x11_window_destroy (GdkWindow *window,
|
|
|
|
gboolean recursing,
|
|
|
|
gboolean foreign_destroy)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2003-07-05 02:34:52 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
2010-12-15 06:39:30 +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
|
|
|
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
|
|
|
|
2010-12-17 00:26:05 +00:00
|
|
|
_gdk_x11_selection_window_destroyed (window);
|
2010-12-15 06:39:30 +00:00
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
if (toplevel)
|
2004-07-11 13:26:57 +00:00
|
|
|
gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
|
2003-07-05 01:54:05 +00:00
|
|
|
|
2010-10-06 01:49:04 +00:00
|
|
|
if (impl->cairo_surface)
|
|
|
|
{
|
|
|
|
cairo_surface_finish (impl->cairo_surface);
|
|
|
|
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
|
2010-12-15 06:39:30 +00:00
|
|
|
NULL, NULL);
|
2010-10-06 01:49:04 +00:00
|
|
|
}
|
2001-11-05 17:48:58 +00:00
|
|
|
|
2004-03-13 18:27:56 +00:00
|
|
|
if (!recursing && !foreign_destroy)
|
2010-12-15 06:39:30 +00:00
|
|
|
XDestroyWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2010-10-05 13:21:40 +00:00
|
|
|
static cairo_surface_t *
|
2010-11-23 01:09:01 +00:00
|
|
|
gdk_window_x11_resize_cairo_surface (GdkWindow *window,
|
2010-10-05 13:21:40 +00:00
|
|
|
cairo_surface_t *surface,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
cairo_xlib_surface_set_size (surface, width, height);
|
|
|
|
|
|
|
|
return surface;
|
|
|
|
}
|
|
|
|
|
2010-12-10 19:06:13 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_destroy_foreign (GdkWindow *window)
|
2004-03-13 18:27:56 +00:00
|
|
|
{
|
2008-12-13 05:20:10 +00:00
|
|
|
/* It's somebody else's window, but in our hierarchy,
|
2004-03-13 18:27:56 +00:00
|
|
|
* so reparent it to the root window, and then send
|
|
|
|
* it a delete event, as if we were a WM
|
|
|
|
*/
|
2007-01-04 01:28:07 +00:00
|
|
|
XClientMessageEvent xclient;
|
2010-12-15 06:39:30 +00:00
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
|
|
display = GDK_WINDOW_DISPLAY (window);
|
|
|
|
gdk_x11_display_error_trap_push (display);
|
2004-03-13 18:27:56 +00:00
|
|
|
gdk_window_hide (window);
|
|
|
|
gdk_window_reparent (window, NULL, 0, 0);
|
2010-12-15 06:39:30 +00:00
|
|
|
|
2007-01-04 01:28:07 +00:00
|
|
|
memset (&xclient, 0, sizeof (xclient));
|
|
|
|
xclient.type = ClientMessage;
|
|
|
|
xclient.window = GDK_WINDOW_XID (window);
|
2010-12-15 06:39:30 +00:00
|
|
|
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "WM_PROTOCOLS");
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.format = 32;
|
2010-12-15 06:39:30 +00:00
|
|
|
xclient.data.l[0] = gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW");
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.data.l[1] = CurrentTime;
|
|
|
|
xclient.data.l[2] = 0;
|
|
|
|
xclient.data.l[3] = 0;
|
|
|
|
xclient.data.l[4] = 0;
|
2004-03-13 18:27:56 +00:00
|
|
|
|
|
|
|
XSendEvent (GDK_WINDOW_XDISPLAY (window),
|
2010-12-15 06:39:30 +00:00
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
False, 0, (XEvent *)&xclient);
|
|
|
|
gdk_x11_display_error_trap_pop_ignored (display);
|
2004-03-13 18:27:56 +00:00
|
|
|
}
|
|
|
|
|
2004-07-09 22:44:35 +00:00
|
|
|
static GdkWindow *
|
|
|
|
get_root (GdkWindow *window)
|
|
|
|
{
|
2010-08-28 23:32:52 +00:00
|
|
|
GdkScreen *screen = gdk_window_get_screen (window);
|
2004-07-09 22:44:35 +00:00
|
|
|
|
|
|
|
return gdk_screen_get_root_window (screen);
|
|
|
|
}
|
|
|
|
|
2000-05-15 16:09:53 +00:00
|
|
|
/* This function is called when the XWindow is really gone.
|
|
|
|
*/
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_destroy_notify (GdkWindow *window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2001-04-18 17:57:36 +00:00
|
|
|
GdkWindowImplX11 *window_impl;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window_impl = GDK_WINDOW_IMPL_X11 ((window)->impl);
|
2001-04-18 17:57:36 +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))
|
1998-03-14 05:15:16 +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_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
|
|
|
|
2000-05-15 16:09:53 +00:00
|
|
|
_gdk_window_destroy (window, TRUE);
|
1998-03-14 05:15:16 +00:00
|
|
|
}
|
2010-12-15 22:45:05 +00:00
|
|
|
|
2010-12-16 04:35:15 +00:00
|
|
|
_gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), GDK_WINDOW_XID (window));
|
2003-07-05 02:34:52 +00:00
|
|
|
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);
|
2002-03-02 20:37:07 +00:00
|
|
|
|
2010-12-15 22:45:05 +00:00
|
|
|
_gdk_x11_window_grab_check_destroy (window);
|
|
|
|
|
2002-09-25 07:23:55 +00:00
|
|
|
g_object_unref (window);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2011-02-01 17:11:35 +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;
|
|
|
|
}
|
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
static void
|
|
|
|
update_wm_hints (GdkWindow *window,
|
|
|
|
gboolean force)
|
|
|
|
{
|
2003-07-05 02:34:52 +00:00
|
|
|
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
|
2003-07-05 01:54:05 +00:00
|
|
|
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
|
|
|
|
XWMHints wm_hints;
|
|
|
|
|
|
|
|
if (!force &&
|
2004-10-18 21:02:37 +00:00
|
|
|
!toplevel->is_leader &&
|
2010-11-22 23:55:39 +00:00
|
|
|
window->state & GDK_WINDOW_STATE_WITHDRAWN)
|
2003-07-05 01:54:05 +00:00
|
|
|
return;
|
|
|
|
|
2003-12-10 23:58:23 +00:00
|
|
|
wm_hints.flags = StateHint | InputHint;
|
2010-11-22 23:55:39 +00:00
|
|
|
wm_hints.input = window->accept_focus ? True : False;
|
2003-07-05 01:54:05 +00:00
|
|
|
wm_hints.initial_state = NormalState;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->state & GDK_WINDOW_STATE_ICONIFIED)
|
2003-07-05 01:54:05 +00:00
|
|
|
{
|
|
|
|
wm_hints.flags |= StateHint;
|
|
|
|
wm_hints.initial_state = IconicState;
|
|
|
|
}
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
if (toplevel->icon_pixmap)
|
2003-07-05 01:54:05 +00:00
|
|
|
{
|
|
|
|
wm_hints.flags |= IconPixmapHint;
|
2010-08-27 10:08:30 +00:00
|
|
|
wm_hints.icon_pixmap = cairo_xlib_surface_get_drawable (toplevel->icon_pixmap);
|
2003-07-05 01:54:05 +00:00
|
|
|
}
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
if (toplevel->icon_mask)
|
2003-07-05 01:54:05 +00:00
|
|
|
{
|
|
|
|
wm_hints.flags |= IconMaskHint;
|
2010-08-27 10:08:30 +00:00
|
|
|
wm_hints.icon_mask = cairo_xlib_surface_get_drawable (toplevel->icon_mask);
|
2003-07-05 01:54:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
wm_hints.flags |= WindowGroupHint;
|
2003-07-05 02:34:52 +00:00
|
|
|
if (toplevel->group_leader && !GDK_WINDOW_DESTROYED (toplevel->group_leader))
|
2003-07-05 01:54:05 +00:00
|
|
|
{
|
|
|
|
wm_hints.flags |= WindowGroupHint;
|
2003-07-05 02:34:52 +00:00
|
|
|
wm_hints.window_group = GDK_WINDOW_XID (toplevel->group_leader);
|
2003-07-05 01:54:05 +00:00
|
|
|
}
|
|
|
|
else
|
2010-12-20 18:20:10 +00:00
|
|
|
wm_hints.window_group = GDK_X11_DISPLAY (display)->leader_window;
|
2005-06-17 20:19:32 +00:00
|
|
|
|
|
|
|
if (toplevel->urgency_hint)
|
|
|
|
wm_hints.flags |= XUrgencyHint;
|
2003-07-05 01:54:05 +00:00
|
|
|
|
|
|
|
XSetWMHints (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
&wm_hints);
|
|
|
|
}
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
static void
|
|
|
|
set_initial_hints (GdkWindow *window)
|
|
|
|
{
|
2002-12-10 23:25:33 +00:00
|
|
|
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
|
|
|
|
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
Window xwindow = GDK_WINDOW_XID (window);
|
2003-07-05 02:34:52 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
2006-04-16 05:05:49 +00:00
|
|
|
Atom atoms[9];
|
2001-02-27 20:40:15 +00:00
|
|
|
gint i;
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
|
|
|
|
if (!toplevel)
|
|
|
|
return;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
update_wm_hints (window, TRUE);
|
|
|
|
|
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;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2002-12-10 23:48:07 +00:00
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
2002-04-25 22:29:14 +00:00
|
|
|
"_NET_WM_STATE_MAXIMIZED_VERT");
|
2001-02-27 20:40:15 +00:00
|
|
|
++i;
|
2002-12-10 23:48:07 +00:00
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
2002-04-25 22:29:14 +00:00
|
|
|
"_NET_WM_STATE_MAXIMIZED_HORZ");
|
2001-02-27 20:40:15 +00:00
|
|
|
++i;
|
2008-05-25 23:09:09 +00:00
|
|
|
toplevel->have_maxhorz = toplevel->have_maxvert = TRUE;
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->state & GDK_WINDOW_STATE_ABOVE)
|
2004-06-26 05:17:59 +00:00
|
|
|
{
|
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
"_NET_WM_STATE_ABOVE");
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->state & GDK_WINDOW_STATE_BELOW)
|
2004-06-26 05:17:59 +00:00
|
|
|
{
|
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
"_NET_WM_STATE_BELOW");
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->state & GDK_WINDOW_STATE_STICKY)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2002-12-10 23:48:07 +00:00
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
2002-04-25 22:29:14 +00:00
|
|
|
"_NET_WM_STATE_STICKY");
|
2001-02-27 20:40:15 +00:00
|
|
|
++i;
|
2008-05-25 23:09:09 +00:00
|
|
|
toplevel->have_sticky = TRUE;
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
|
2002-09-25 19:16:46 +00:00
|
|
|
{
|
2002-12-10 23:48:07 +00:00
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
2002-09-25 19:16:46 +00:00
|
|
|
"_NET_WM_STATE_FULLSCREEN");
|
|
|
|
++i;
|
2008-05-25 23:09:09 +00:00
|
|
|
toplevel->have_fullscreen = TRUE;
|
2002-09-25 19:16:46 +00:00
|
|
|
}
|
2003-04-21 19:03:15 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->modal_hint)
|
2001-03-05 15:09:02 +00:00
|
|
|
{
|
2002-12-10 23:48:07 +00:00
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
2002-04-25 22:29:14 +00:00
|
|
|
"_NET_WM_STATE_MODAL");
|
2001-03-05 15:09:02 +00:00
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
if (toplevel->skip_taskbar_hint)
|
2003-04-21 19:03:15 +00:00
|
|
|
{
|
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
"_NET_WM_STATE_SKIP_TASKBAR");
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
if (toplevel->skip_pager_hint)
|
2003-04-21 19:03:15 +00:00
|
|
|
{
|
|
|
|
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
"_NET_WM_STATE_SKIP_PAGER");
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
2012-02-21 16:14:16 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
if (i > 0)
|
|
|
|
{
|
2002-12-10 23:25:33 +00:00
|
|
|
XChangeProperty (xdisplay,
|
|
|
|
xwindow,
|
2002-12-10 23:48:07 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
|
2001-02-27 20:40:15 +00:00
|
|
|
XA_ATOM, 32, PropModeReplace,
|
|
|
|
(guchar*) atoms, i);
|
|
|
|
}
|
2002-12-10 23:25:33 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
XDeleteProperty (xdisplay,
|
|
|
|
xwindow,
|
2002-12-10 23:48:07 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"));
|
2002-12-10 23:25:33 +00:00
|
|
|
}
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->state & GDK_WINDOW_STATE_STICKY)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
|
|
|
atoms[0] = 0xFFFFFFFF;
|
2002-12-10 23:25:33 +00:00
|
|
|
XChangeProperty (xdisplay,
|
|
|
|
xwindow,
|
2002-12-10 23:48:07 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
|
2001-02-27 20:40:15 +00:00
|
|
|
XA_CARDINAL, 32, PropModeReplace,
|
|
|
|
(guchar*) atoms, 1);
|
2008-05-25 23:09:09 +00:00
|
|
|
toplevel->on_all_desktops = TRUE;
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
2002-12-10 23:25:33 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
XDeleteProperty (xdisplay,
|
|
|
|
xwindow,
|
2002-12-10 23:48:07 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"));
|
2002-12-10 23:25:33 +00:00
|
|
|
}
|
2003-07-05 02:34:52 +00:00
|
|
|
|
|
|
|
toplevel->map_serial = NextRequest (xdisplay);
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
|
2001-06-28 05:24:00 +00:00
|
|
|
static void
|
2009-06-16 19:34:37 +00:00
|
|
|
gdk_window_x11_show (GdkWindow *window, gboolean already_mapped)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2004-08-23 17:10:34 +00:00
|
|
|
GdkDisplay *display;
|
2010-12-20 16:14:04 +00:00
|
|
|
GdkX11Display *display_x11;
|
2004-08-23 17:10:34 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2008-12-18 10:30:10 +00:00
|
|
|
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
|
|
|
|
Window xwindow = GDK_WINDOW_XID (window);
|
|
|
|
gboolean unset_bg;
|
2009-06-16 19:34:37 +00:00
|
|
|
|
|
|
|
if (!already_mapped)
|
|
|
|
set_initial_hints (window);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
2008-12-18 10:30:10 +00:00
|
|
|
if (WINDOW_IS_TOPLEVEL (window))
|
|
|
|
{
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2010-12-20 18:20:10 +00:00
|
|
|
display_x11 = GDK_X11_DISPLAY (display);
|
2008-12-18 10:30:10 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
2008-12-18 10:30:10 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
unset_bg = !window->input_only &&
|
|
|
|
(window->window_type == GDK_WINDOW_CHILD ||
|
2008-12-18 10:30:10 +00:00
|
|
|
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)
|
2008-12-18 21:08:39 +00:00
|
|
|
_gdk_x11_window_tmp_reset_bg (window, TRUE);
|
2013-01-21 10:52:32 +00:00
|
|
|
|
|
|
|
/* 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
|
|
|
}
|
|
|
|
|
2004-07-09 22:44:35 +00:00
|
|
|
static void
|
|
|
|
pre_unmap (GdkWindow *window)
|
|
|
|
{
|
|
|
|
GdkWindow *start_window = NULL;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->input_only)
|
2004-07-09 22:44:35 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
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)
|
2004-07-09 22:44:35 +00:00
|
|
|
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;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->input_only)
|
2004-07-09 22:44:35 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
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)
|
2004-07-09 22:44:35 +00:00
|
|
|
start_window = get_root (window);
|
|
|
|
|
|
|
|
if (start_window)
|
|
|
|
{
|
|
|
|
_gdk_x11_window_tmp_reset_bg (start_window, TRUE);
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->window_type == GDK_WINDOW_CHILD && window->parent)
|
2004-07-09 22:44:35 +00:00
|
|
|
{
|
|
|
|
GdkRectangle invalid_rect;
|
|
|
|
|
|
|
|
gdk_window_get_position (window, &invalid_rect.x, &invalid_rect.y);
|
2010-09-20 10:52:26 +00:00
|
|
|
invalid_rect.width = gdk_window_get_width (window);
|
|
|
|
invalid_rect.height = gdk_window_get_height (window);
|
2010-11-22 23:55:39 +00:00
|
|
|
gdk_window_invalidate_rect ((GdkWindow *)window->parent,
|
2004-07-09 22:44:35 +00:00
|
|
|
&invalid_rect, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
|
|
|
gdk_window_x11_hide (GdkWindow *window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2002-03-02 20:37:07 +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.
|
|
|
|
*/
|
2010-12-15 22:45:05 +00:00
|
|
|
_gdk_x11_window_grab_check_unmap (window,
|
|
|
|
NextRequest (GDK_WINDOW_XDISPLAY (window)));
|
2002-03-02 20:37:07 +00:00
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
/* You can't simply unmap toplevel windows. */
|
2010-11-22 23:55:39 +00:00
|
|
|
switch (window->window_type)
|
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;
|
|
|
|
}
|
|
|
|
|
2008-12-18 10:30:10 +00:00
|
|
|
_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
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
|
|
|
gdk_window_x11_withdraw (GdkWindow *window)
|
1998-01-01 20:38:21 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
if (!window->destroyed)
|
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));
|
2004-07-09 22:44:35 +00:00
|
|
|
|
|
|
|
pre_unmap (window);
|
2001-02-27 20:40:15 +00:00
|
|
|
|
|
|
|
XWithdrawWindow (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window), 0);
|
2004-07-09 22:44:35 +00:00
|
|
|
|
|
|
|
post_unmap (window);
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
1998-01-01 20:38:21 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static inline void
|
|
|
|
window_x11_move (GdkWindow *window,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
|
2000-09-01 20:10:58 +00:00
|
|
|
{
|
2012-11-14 17:23:41 +00:00
|
|
|
/* The window isn't actually damaged, but it's parent is */
|
|
|
|
window_pre_damage (window);
|
2010-12-16 03:21:39 +00:00
|
|
|
_gdk_x11_window_move_resize_child (window,
|
|
|
|
x, y,
|
|
|
|
window->width, window->height);
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
XMoveWindow (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
x, y);
|
2004-07-09 21:27:09 +00:00
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
if (impl->override_redirect)
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
window->x = x;
|
|
|
|
window->y = y;
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
2000-09-01 20:10:58 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +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;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (height < 1)
|
|
|
|
height = 1;
|
1999-10-03 22:12:41 +00:00
|
|
|
|
2012-11-14 17:23:41 +00:00
|
|
|
window_pre_damage (window);
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-12-16 03:21:39 +00:00
|
|
|
_gdk_x11_window_move_resize_child (window,
|
|
|
|
window->x, window->y,
|
|
|
|
width, height);
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2004-07-09 21:27:09 +00:00
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
XResizeWindow (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
width, height);
|
2005-05-17 17:35:22 +00:00
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
if (impl->override_redirect)
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
window->width = width;
|
|
|
|
window->height = height;
|
|
|
|
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
if (width != window->width || height != window->height)
|
|
|
|
window->resize_count += 1;
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +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;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (height < 1)
|
|
|
|
height = 1;
|
1999-10-03 22:12:41 +00:00
|
|
|
|
2012-11-14 17:23:41 +00:00
|
|
|
window_pre_damage (window);
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-12-16 03:21:39 +00:00
|
|
|
_gdk_x11_window_move_resize_child (window, x, y, width, height);
|
2010-11-22 23:55:39 +00:00
|
|
|
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2004-07-09 21:27:09 +00:00
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
x, y, width, height);
|
2005-05-17 17:35:22 +00:00
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
if (impl->override_redirect)
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
window->x = x;
|
|
|
|
window->y = y;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window->width = width;
|
|
|
|
window->height = height;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
if (width != window->width || height != window->height)
|
|
|
|
window->resize_count += 1;
|
2008-06-27 14:27:44 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +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 gboolean
|
|
|
|
gdk_window_x11_reparent (GdkWindow *window,
|
|
|
|
GdkWindow *new_parent,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2003-12-21 16:37:43 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2008-12-18 21:08:39 +00:00
|
|
|
_gdk_x11_window_tmp_unset_bg (window, TRUE);
|
2009-01-27 15:43:03 +00:00
|
|
|
_gdk_x11_window_tmp_unset_parent_bg (window);
|
2004-03-13 18:27:56 +00:00
|
|
|
XReparentWindow (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
GDK_WINDOW_XID (new_parent),
|
2010-11-22 23:55:39 +00:00
|
|
|
new_parent->abs_x + x, new_parent->abs_y + y);
|
2009-01-27 15:43:03 +00:00
|
|
|
_gdk_x11_window_tmp_reset_parent_bg (window);
|
2008-12-18 21:08:39 +00:00
|
|
|
_gdk_x11_window_tmp_reset_bg (window, TRUE);
|
2001-10-24 14:15:50 +00:00
|
|
|
|
|
|
|
if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
|
2002-04-25 22:29:14 +00:00
|
|
|
new_parent = gdk_screen_get_root_window (GDK_WINDOW_SCREEN (window));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window->parent = new_parent;
|
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:
|
2008-07-18 13:03:42 +00:00
|
|
|
/* 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 */
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->toplevel_window_type != -1)
|
|
|
|
GDK_WINDOW_TYPE (window) = window->toplevel_window_type;
|
2008-07-18 13:03:42 +00:00
|
|
|
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);
|
|
|
|
}
|
2003-12-21 16:37:43 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
break;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
2001-07-05 02:58:34 +00:00
|
|
|
case GDK_WINDOW_TOPLEVEL:
|
|
|
|
case GDK_WINDOW_CHILD:
|
|
|
|
case GDK_WINDOW_TEMP:
|
2008-07-18 13:03:42 +00:00
|
|
|
if (WINDOW_IS_TOPLEVEL (window) &&
|
|
|
|
impl->toplevel)
|
2001-07-05 02:58:34 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (impl->toplevel->focus_window)
|
2003-07-05 02:34:52 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
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);
|
2003-07-05 02:34:52 +00:00
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window),
|
|
|
|
impl->toplevel);
|
|
|
|
g_free (impl->toplevel);
|
|
|
|
impl->toplevel = NULL;
|
2001-07-05 02:58:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-28 00:32:17 +00:00
|
|
|
return FALSE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
|
|
|
gdk_window_x11_raise (GdkWindow *window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2009-01-19 11:47:38 +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
|
|
|
}
|
|
|
|
|
2009-09-02 21:38:55 +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),
|
2009-10-01 15:47:22 +00:00
|
|
|
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)),
|
2009-09-02 21:38:55 +00:00
|
|
|
CWStackMode | CWSibling, &changes);
|
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
|
|
|
gdk_window_x11_lower (GdkWindow *window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2009-01-19 11:47:38 +00:00
|
|
|
XLowerWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2005-07-11 18:28:23 +00:00
|
|
|
/**
|
|
|
|
* gdk_x11_window_move_to_current_desktop:
|
2011-07-28 11:27:23 +00:00
|
|
|
* @window: (type GdkX11Window): a #GdkWindow
|
2005-07-11 18:28:23 +00:00
|
|
|
*
|
|
|
|
* Moves the window to the correct workspace when running under a
|
|
|
|
* window manager that supports multiple workspaces, as described
|
|
|
|
* in the <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
|
2005-08-01 16:01:24 +00:00
|
|
|
* Window Manager Hints</ulink>. Will not do anything if the
|
|
|
|
* window is already on all workspaces.
|
2005-07-11 18:28:23 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_x11_window_move_to_current_desktop (GdkWindow *window)
|
|
|
|
{
|
2005-08-01 16:01:24 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
2007-01-30 18:36:44 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
|
|
|
|
|
2005-08-01 16:01:24 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
|
|
|
|
if (toplevel->on_all_desktops)
|
|
|
|
return;
|
2006-05-25 05:30:14 +00:00
|
|
|
|
|
|
|
move_to_current_desktop (window);
|
|
|
|
}
|
2005-08-01 16:01:24 +00:00
|
|
|
|
2006-05-25 05:30:14 +00:00
|
|
|
static void
|
|
|
|
move_to_current_desktop (GdkWindow *window)
|
|
|
|
{
|
2005-07-11 18:28:23 +00:00
|
|
|
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
2013-01-10 04:40:04 +00:00
|
|
|
gdk_atom_intern_static_string ("_NET_WM_DESKTOP")) &&
|
|
|
|
gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
|
|
|
gdk_atom_intern_static_string ("_NET_CURRENT_DESKTOP")))
|
2005-07-11 18:28:23 +00:00
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
gint format;
|
|
|
|
gulong nitems;
|
|
|
|
gulong bytes_after;
|
|
|
|
guchar *data;
|
|
|
|
gulong *current_desktop;
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2005-07-11 18:28:23 +00:00
|
|
|
|
|
|
|
/* Get current desktop, then set it; this is a race, but not
|
|
|
|
* one that matters much in practice.
|
|
|
|
*/
|
|
|
|
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
GDK_WINDOW_XROOTWIN (window),
|
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_CURRENT_DESKTOP"),
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, XA_CARDINAL, &type, &format, &nitems,
|
|
|
|
&bytes_after, &data);
|
|
|
|
|
|
|
|
if (type == XA_CARDINAL)
|
|
|
|
{
|
2007-01-04 01:28:07 +00:00
|
|
|
XClientMessageEvent xclient;
|
2005-07-11 18:28:23 +00:00
|
|
|
current_desktop = (gulong *)data;
|
|
|
|
|
2007-01-04 01:28:07 +00:00
|
|
|
memset (&xclient, 0, sizeof (xclient));
|
|
|
|
xclient.type = ClientMessage;
|
|
|
|
xclient.serial = 0;
|
|
|
|
xclient.send_event = True;
|
2010-11-22 16:06:46 +00:00
|
|
|
xclient.window = GDK_WINDOW_XID (window);
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP");
|
|
|
|
xclient.format = 32;
|
|
|
|
|
|
|
|
xclient.data.l[0] = *current_desktop;
|
2011-12-28 16:16:54 +00:00
|
|
|
xclient.data.l[1] = 1; /* source indication */
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.data.l[2] = 0;
|
|
|
|
xclient.data.l[3] = 0;
|
|
|
|
xclient.data.l[4] = 0;
|
2005-07-11 18:28:23 +00:00
|
|
|
|
|
|
|
XSendEvent (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
GDK_WINDOW_XROOTWIN (window),
|
|
|
|
False,
|
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
2007-01-04 01:28:07 +00:00
|
|
|
(XEvent *)&xclient);
|
2005-07-11 18:28:23 +00:00
|
|
|
|
|
|
|
XFree (current_desktop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_focus (GdkWindow *window,
|
|
|
|
guint32 timestamp)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2003-07-05 01:54:05 +00:00
|
|
|
GdkDisplay *display;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2009-08-07 16:00:10 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-02-27 20:40:15 +00:00
|
|
|
return;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
display = GDK_WINDOW_DISPLAY (window);
|
|
|
|
|
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")))
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2007-01-04 01:28:07 +00:00
|
|
|
XClientMessageEvent xclient;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2007-01-04 01:28:07 +00:00
|
|
|
memset (&xclient, 0, sizeof (xclient));
|
|
|
|
xclient.type = ClientMessage;
|
2010-11-22 16:06:46 +00:00
|
|
|
xclient.window = GDK_WINDOW_XID (window);
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
|
2011-12-28 16:16:54 +00:00
|
|
|
"_NET_ACTIVE_WINDOW");
|
2007-01-04 01:28:07 +00:00
|
|
|
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;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
|
2001-02-27 20:40:15 +00:00
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
2007-01-04 01:28:07 +00:00
|
|
|
(XEvent *)&xclient);
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-18 17:42:17 +00:00
|
|
|
XRaiseWindow (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window));
|
2001-05-02 21:31:52 +00:00
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
/* There is no way of knowing reliably whether we are viewable;
|
2011-02-27 03:13:06 +00:00
|
|
|
* so trap errors asynchronously around the XSetInputFocus call
|
2001-05-02 21:31:52 +00:00
|
|
|
*/
|
2011-02-27 03:13:06 +00:00
|
|
|
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);
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_type_hint (GdkWindow *window,
|
|
|
|
GdkWindowTypeHint hint)
|
2001-03-05 15:09:02 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
|
|
|
Atom atom;
|
2001-03-05 15:09:02 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-03-05 15:09:02 +00:00
|
|
|
return;
|
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2001-03-05 15:09:02 +00:00
|
|
|
switch (hint)
|
|
|
|
{
|
|
|
|
case GDK_WINDOW_TYPE_HINT_DIALOG:
|
2002-04-25 22:29:14 +00:00
|
|
|
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG");
|
2001-03-05 15:09:02 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_TYPE_HINT_MENU:
|
2002-04-25 22:29:14 +00:00
|
|
|
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU");
|
2001-03-05 15:09:02 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
|
2002-04-25 22:29:14 +00:00
|
|
|
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR");
|
2001-03-05 15:09:02 +00:00
|
|
|
break;
|
2002-09-25 19:16:46 +00:00
|
|
|
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:
|
2002-11-25 22:05:52 +00:00
|
|
|
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH");
|
2002-09-25 19:16:46 +00:00
|
|
|
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;
|
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;
|
2001-03-05 15:09:02 +00:00
|
|
|
default:
|
|
|
|
g_warning ("Unknown hint %d passed to gdk_window_set_type_hint", hint);
|
|
|
|
/* Fall thru */
|
|
|
|
case GDK_WINDOW_TYPE_HINT_NORMAL:
|
2002-04-25 22:29:14 +00:00
|
|
|
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NORMAL");
|
2001-03-05 15:09:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
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"),
|
2001-03-05 15:09:02 +00:00
|
|
|
XA_ATOM, 32, PropModeReplace,
|
|
|
|
(guchar *)&atom, 1);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static GdkWindowTypeHint
|
|
|
|
gdk_x11_window_get_type_hint (GdkWindow *window)
|
2005-11-08 14:45:32 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2005-11-08 14:45:32 +00:00
|
|
|
return GDK_WINDOW_TYPE_HINT_NORMAL;
|
|
|
|
|
|
|
|
type = GDK_WINDOW_TYPE_HINT_NORMAL;
|
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2005-11-08 14:45:32 +00:00
|
|
|
|
|
|
|
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))
|
|
|
|
{
|
2006-07-27 15:22:13 +00:00
|
|
|
Atom atom = *(Atom*)data;
|
2005-11-08 14:45:32 +00:00
|
|
|
|
|
|
|
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;
|
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;
|
2005-11-08 14:45:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (type_return != None && data != NULL)
|
|
|
|
XFree (data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return type;
|
|
|
|
}
|
2001-03-05 15:09:02 +00:00
|
|
|
|
|
|
|
static void
|
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
|
|
|
gdk_wmspec_change_state (gboolean add,
|
2001-03-05 15:09:02 +00:00
|
|
|
GdkWindow *window,
|
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
|
|
|
GdkAtom state1,
|
|
|
|
GdkAtom state2)
|
2001-03-05 15:09:02 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
|
2007-01-04 01:28:07 +00:00
|
|
|
XClientMessageEvent xclient;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2001-07-03 01:39:36 +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 */
|
2001-03-05 15:09:02 +00:00
|
|
|
|
2007-01-04 01:28:07 +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_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);
|
2011-12-28 16:16:54 +00:00
|
|
|
xclient.data.l[3] = 1; /* source indication */
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.data.l[4] = 0;
|
2001-03-05 15:09:02 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False,
|
2001-03-05 15:09:02 +00:00
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
2007-01-04 01:28:07 +00:00
|
|
|
(XEvent *)&xclient);
|
2001-03-05 15:09:02 +00:00
|
|
|
}
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_modal_hint (GdkWindow *window,
|
|
|
|
gboolean modal)
|
2001-03-05 15:09:02 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-03-05 15:09:02 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window->modal_hint = modal;
|
2001-03-05 15:09:02 +00:00
|
|
|
|
|
|
|
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"),
|
2009-06-06 03:06:12 +00:00
|
|
|
GDK_NONE);
|
2001-03-05 15:09:02 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_skip_taskbar_hint (GdkWindow *window,
|
|
|
|
gboolean skips_taskbar)
|
2002-09-25 19:16:46 +00:00
|
|
|
{
|
2003-07-05 02:34:52 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
2002-09-25 19:16:46 +00:00
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
|
2002-09-25 19:16:46 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2002-09-25 19:16:46 +00:00
|
|
|
return;
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
toplevel->skip_taskbar_hint = skips_taskbar;
|
2002-09-25 19:16:46 +00:00
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
gdk_wmspec_change_state (skips_taskbar, window,
|
2009-06-06 03:06:12 +00:00
|
|
|
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"),
|
|
|
|
GDK_NONE);
|
2002-09-25 19:16:46 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_skip_pager_hint (GdkWindow *window,
|
|
|
|
gboolean skips_pager)
|
2002-09-25 19:16:46 +00:00
|
|
|
{
|
2003-07-05 02:34:52 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
|
2002-09-25 19:16:46 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2002-09-25 19:16:46 +00:00
|
|
|
return;
|
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
toplevel->skip_pager_hint = skips_pager;
|
2002-09-25 19:16:46 +00:00
|
|
|
|
|
|
|
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"),
|
2009-06-06 03:06:12 +00:00
|
|
|
GDK_NONE);
|
2002-09-25 19:16:46 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_urgency_hint (GdkWindow *window,
|
2005-06-17 20:19:32 +00:00
|
|
|
gboolean urgent)
|
|
|
|
{
|
|
|
|
GdkToplevelX11 *toplevel;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2005-06-17 20:19:32 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
toplevel->urgency_hint = urgent;
|
|
|
|
|
|
|
|
update_wm_hints (window, FALSE);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_geometry_hints (GdkWindow *window,
|
|
|
|
const GdkGeometry *geometry,
|
|
|
|
GdkWindowHints geom_mask)
|
1998-12-07 06:37:27 +00:00
|
|
|
{
|
|
|
|
XSizeHints size_hints;
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
1998-12-07 06:37:27 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
1998-12-07 06:37:27 +00:00
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_MIN_SIZE)
|
|
|
|
{
|
|
|
|
size_hints.flags |= PMinSize;
|
|
|
|
size_hints.min_width = geometry->min_width;
|
|
|
|
size_hints.min_height = geometry->min_height;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_MAX_SIZE)
|
|
|
|
{
|
|
|
|
size_hints.flags |= PMaxSize;
|
1999-02-21 22:12:00 +00:00
|
|
|
size_hints.max_width = MAX (geometry->max_width, 1);
|
|
|
|
size_hints.max_height = MAX (geometry->max_height, 1);
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_BASE_SIZE)
|
|
|
|
{
|
|
|
|
size_hints.flags |= PBaseSize;
|
|
|
|
size_hints.base_width = geometry->base_width;
|
|
|
|
size_hints.base_height = geometry->base_height;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_RESIZE_INC)
|
|
|
|
{
|
|
|
|
size_hints.flags |= PResizeInc;
|
|
|
|
size_hints.width_inc = geometry->width_inc;
|
|
|
|
size_hints.height_inc = geometry->height_inc;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
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;;
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
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;
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
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;;
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
}
|
[ 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
|
|
|
|
2000-10-04 16:51:42 +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;
|
2000-10-04 16:51:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-06 14:35:58 +00:00
|
|
|
/* 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),
|
1999-10-03 22:12:41 +00:00
|
|
|
&size_hints);
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
static void
|
|
|
|
gdk_window_get_geometry_hints (GdkWindow *window,
|
|
|
|
GdkGeometry *geometry,
|
|
|
|
GdkWindowHints *geom_mask)
|
|
|
|
{
|
2006-08-15 05:53:58 +00:00
|
|
|
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;
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-03-29 21:17:45 +00:00
|
|
|
return;
|
2006-08-15 05:53:58 +00:00
|
|
|
|
|
|
|
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),
|
2006-08-15 05:53:58 +00:00
|
|
|
size_hints,
|
|
|
|
&junk_supplied_mask))
|
|
|
|
size_hints->flags = 0;
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2006-08-15 05:53:58 +00:00
|
|
|
if (size_hints->flags & PMinSize)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
*geom_mask |= GDK_HINT_MIN_SIZE;
|
2006-08-15 05:53:58 +00:00
|
|
|
geometry->min_width = size_hints->min_width;
|
|
|
|
geometry->min_height = size_hints->min_height;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2006-08-15 05:53:58 +00:00
|
|
|
if (size_hints->flags & PMaxSize)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
*geom_mask |= GDK_HINT_MAX_SIZE;
|
2006-08-15 05:53:58 +00:00
|
|
|
geometry->max_width = MAX (size_hints->max_width, 1);
|
|
|
|
geometry->max_height = MAX (size_hints->max_height, 1);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2006-08-15 05:53:58 +00:00
|
|
|
if (size_hints->flags & PResizeInc)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
*geom_mask |= GDK_HINT_RESIZE_INC;
|
2006-08-15 05:53:58 +00:00
|
|
|
geometry->width_inc = size_hints->width_inc;
|
|
|
|
geometry->height_inc = size_hints->height_inc;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2006-08-15 05:53:58 +00:00
|
|
|
if (size_hints->flags & PAspect)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
*geom_mask |= GDK_HINT_ASPECT;
|
|
|
|
|
2006-08-15 05:53:58 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2006-08-15 05:53:58 +00:00
|
|
|
if (size_hints->flags & PWinGravity)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
*geom_mask |= GDK_HINT_WIN_GRAVITY;
|
2006-08-15 05:53:58 +00:00
|
|
|
geometry->win_gravity = size_hints->win_gravity;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
2006-08-15 05:53:58 +00:00
|
|
|
|
|
|
|
XFree (size_hints);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2000-10-04 16:51:42 +00:00
|
|
|
static gboolean
|
|
|
|
utf8_is_latin1 (const gchar *str)
|
|
|
|
{
|
|
|
|
const char *p = str;
|
|
|
|
|
|
|
|
while (*p)
|
|
|
|
{
|
|
|
|
gunichar ch = g_utf8_get_char (p);
|
|
|
|
|
2001-06-06 14:35:58 +00:00
|
|
|
if (ch > 0xff)
|
2000-10-04 16:51:42 +00:00
|
|
|
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
|
2002-11-08 22:29:33 +00:00
|
|
|
set_text_property (GdkDisplay *display,
|
|
|
|
Window xwindow,
|
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
|
|
|
Atom property,
|
2000-10-04 16:51:42 +00:00
|
|
|
const gchar *utf8_str)
|
|
|
|
{
|
2005-09-13 19:14:51 +00:00
|
|
|
gchar *prop_text = NULL;
|
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
|
|
|
Atom prop_type;
|
2000-10-04 16:51:42 +00:00
|
|
|
gint prop_length;
|
|
|
|
gint prop_format;
|
2004-02-26 18:28:07 +00:00
|
|
|
gboolean is_compound_text;
|
2000-10-04 16:51:42 +00:00
|
|
|
|
|
|
|
if (utf8_is_latin1 (utf8_str))
|
|
|
|
{
|
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
|
|
|
prop_type = XA_STRING;
|
2010-12-27 06:02:52 +00:00
|
|
|
prop_text = _gdk_x11_display_utf8_to_string_target (display, utf8_str);
|
2002-04-04 23:10:58 +00:00
|
|
|
prop_length = prop_text ? strlen (prop_text) : 0;
|
2000-10-04 16:51:42 +00:00
|
|
|
prop_format = 8;
|
2004-02-26 18:28:07 +00:00
|
|
|
is_compound_text = FALSE;
|
2000-10-04 16:51:42 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
|
|
|
GdkAtom gdk_type;
|
2010-12-17 04:44:50 +00:00
|
|
|
|
|
|
|
gdk_x11_display_utf8_to_compound_text (display,
|
|
|
|
utf8_str, &gdk_type, &prop_format,
|
|
|
|
(guchar **)&prop_text, &prop_length);
|
2002-11-08 22:29:33 +00:00
|
|
|
prop_type = gdk_x11_atom_to_xatom_for_display (display, gdk_type);
|
2004-02-26 18:28:07 +00:00
|
|
|
is_compound_text = TRUE;
|
2000-10-04 16:51:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (prop_text)
|
|
|
|
{
|
2002-11-08 22:29:33 +00:00
|
|
|
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
xwindow,
|
2000-10-04 16:51:42 +00:00
|
|
|
property,
|
|
|
|
prop_type, prop_format,
|
2005-09-13 19:14:51 +00:00
|
|
|
PropModeReplace, (guchar *)prop_text,
|
2000-10-04 16:51:42 +00:00
|
|
|
prop_length);
|
|
|
|
|
2004-02-26 18:28:07 +00:00
|
|
|
if (is_compound_text)
|
2010-12-17 04:44:50 +00:00
|
|
|
gdk_x11_free_compound_text ((guchar *)prop_text);
|
2004-02-26 18:28:07 +00:00
|
|
|
else
|
|
|
|
g_free (prop_text);
|
2000-10-04 16:51:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-11-08 22:29:33 +00:00
|
|
|
/* 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,
|
2005-09-13 19:14:51 +00:00
|
|
|
PropModeReplace, (guchar *)name, strlen (name));
|
2002-11-08 22:29:33 +00:00
|
|
|
|
|
|
|
set_text_property (display, xwindow,
|
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "WM_NAME"),
|
|
|
|
name);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_title (GdkWindow *window,
|
|
|
|
const gchar *title)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
2002-11-08 22:29:33 +00:00
|
|
|
Display *xdisplay;
|
|
|
|
Window xwindow;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
g_return_if_fail (title != NULL);
|
2000-10-04 16:51:42 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2000-10-04 16:51:42 +00:00
|
|
|
return;
|
1998-03-08 03:32:05 +00:00
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2002-11-08 22:29:33 +00:00
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
xwindow = GDK_WINDOW_XID (window);
|
2000-10-04 16:51:42 +00:00
|
|
|
|
2002-11-08 22:29:33 +00:00
|
|
|
set_wm_name (display, xwindow, title);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2000-10-04 16:51:42 +00:00
|
|
|
if (!gdk_window_icon_name_set (window))
|
2001-03-05 15:09:02 +00:00
|
|
|
{
|
2002-11-08 22:29:33 +00:00
|
|
|
XChangeProperty (xdisplay, xwindow,
|
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,
|
2005-09-13 19:14:51 +00:00
|
|
|
PropModeReplace, (guchar *)title, strlen (title));
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-11-08 22:29:33 +00:00
|
|
|
set_text_property (display, xwindow,
|
2002-04-25 22:29:14 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"),
|
|
|
|
title);
|
2001-03-05 15:09:02 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_role (GdkWindow *window,
|
|
|
|
const gchar *role)
|
1998-12-07 06:37:27 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
2009-08-07 16:00:10 +00:00
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2009-08-07 16:00:10 +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"));
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_startup_id (GdkWindow *window,
|
|
|
|
const gchar *startup_id)
|
2007-03-13 17:03:54 +00:00
|
|
|
{
|
|
|
|
GdkDisplay *display;
|
2009-08-07 16:00:10 +00:00
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2007-03-13 17:03:54 +00:00
|
|
|
|
2009-08-07 16:00:10 +00:00
|
|
|
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"));
|
2007-03-13 17:03:54 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_transient_for (GdkWindow *window,
|
|
|
|
GdkWindow *parent)
|
1998-12-07 06:37:27 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window) && !GDK_WINDOW_DESTROYED (parent) &&
|
2009-08-07 16:00:10 +00:00
|
|
|
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));
|
1998-12-07 06:37:27 +00:00
|
|
|
}
|
|
|
|
|
2010-08-29 09:52:29 +00:00
|
|
|
static gboolean
|
2010-08-15 11:49:30 +00:00
|
|
|
gdk_window_x11_set_back_color (GdkWindow *window,
|
2010-08-29 09:52:29 +00:00
|
|
|
double red,
|
|
|
|
double green,
|
|
|
|
double blue,
|
|
|
|
double alpha)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-29 09:52:29 +00:00
|
|
|
GdkVisual *visual = gdk_window_get_visual (window);
|
2010-07-31 09:20:46 +00:00
|
|
|
|
2010-08-29 09:52:29 +00:00
|
|
|
/* I suppose we could handle these, but that'd require fiddling with
|
|
|
|
* xrender formats... */
|
|
|
|
if (alpha != 1.0)
|
|
|
|
return FALSE;
|
2010-07-31 09:20:46 +00:00
|
|
|
|
2010-08-29 09:52:29 +00:00
|
|
|
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 );
|
2010-07-31 09:20:46 +00:00
|
|
|
|
2010-08-29 09:52:29 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2010-08-15 11:49:30 +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;
|
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
2010-08-15 11:49:30 +00:00
|
|
|
gdk_window_x11_set_background (GdkWindow *window,
|
|
|
|
cairo_pattern_t *pattern)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-15 11:49:30 +00:00
|
|
|
double r, g, b, a;
|
|
|
|
cairo_surface_t *surface;
|
|
|
|
cairo_matrix_t matrix;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (pattern == NULL)
|
|
|
|
{
|
2010-09-29 10:06:19 +00:00
|
|
|
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);
|
2010-08-15 11:49:30 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (cairo_pattern_get_type (pattern))
|
|
|
|
{
|
|
|
|
case CAIRO_PATTERN_TYPE_SOLID:
|
|
|
|
cairo_pattern_get_rgba (pattern, &r, &g, &b, &a);
|
2010-08-29 09:52:29 +00:00
|
|
|
if (gdk_window_x11_set_back_color (window, r, g, b, a))
|
|
|
|
return;
|
2010-08-15 11:49:30 +00:00
|
|
|
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 &&
|
2010-10-15 14:58:29 +00:00
|
|
|
cairo_xlib_surface_get_visual (surface) == GDK_VISUAL_XVISUAL (gdk_window_get_visual ((window))) &&
|
2010-08-15 11:49:30 +00:00
|
|
|
cairo_xlib_surface_get_display (surface) == GDK_WINDOW_XDISPLAY (window))
|
|
|
|
{
|
|
|
|
double x, y;
|
|
|
|
|
|
|
|
cairo_surface_get_device_offset (surface, &x, &y);
|
|
|
|
/* 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)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:52:29 +00:00
|
|
|
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window), None);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +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
|
|
|
{
|
2005-06-15 18:37:18 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
2005-06-15 16:59:20 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
g_return_if_fail (GDK_IS_DEVICE (device));
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2005-06-15 18:37:18 +00:00
|
|
|
|
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
|
2005-06-17 17:26:24 +00:00
|
|
|
{
|
|
|
|
_gdk_x11_cursor_update_theme (cursor);
|
2010-05-25 22:38:44 +00:00
|
|
|
g_hash_table_replace (impl->device_cursor,
|
2010-12-20 02:12:33 +00:00
|
|
|
device, g_object_ref (cursor));
|
2005-06-17 17:26:24 +00:00
|
|
|
}
|
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);
|
2005-06-15 18:37:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GdkCursor *
|
|
|
|
_gdk_x11_window_get_cursor (GdkWindow *window)
|
|
|
|
{
|
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
|
2005-06-16 22:35:45 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
|
2005-06-15 18:37:18 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2005-06-15 18:37:18 +00:00
|
|
|
|
|
|
|
return impl->cursor;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
|
|
|
gdk_window_x11_get_geometry (GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
2010-12-05 13:40:35 +00:00
|
|
|
gint *height)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
Window root;
|
|
|
|
gint tx;
|
|
|
|
gint ty;
|
|
|
|
guint twidth;
|
|
|
|
guint theight;
|
|
|
|
guint tborder_width;
|
|
|
|
guint tdepth;
|
1998-03-08 03:32:05 +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))
|
1998-01-26 01:20:14 +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
|
|
|
XGetGeometry (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
1998-01-26 01:20:14 +00:00
|
|
|
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
|
|
|
|
|
|
|
|
if (x)
|
|
|
|
*x = tx;
|
|
|
|
if (y)
|
|
|
|
*y = ty;
|
|
|
|
if (width)
|
|
|
|
*width = twidth;
|
|
|
|
if (height)
|
|
|
|
*height = theight;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static gint
|
2009-06-08 15:03:47 +00:00
|
|
|
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
|
|
|
{
|
|
|
|
gint return_val;
|
|
|
|
Window child;
|
2009-06-30 07:30:53 +00:00
|
|
|
gint tx;
|
|
|
|
gint ty;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2009-06-30 07:30:53 +00:00
|
|
|
return_val = XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
GDK_WINDOW_XROOTWIN (window),
|
|
|
|
x, y, &tx, &ty,
|
|
|
|
&child);
|
1998-01-26 01:20:14 +00:00
|
|
|
|
2009-06-08 15:03:47 +00:00
|
|
|
if (root_x)
|
|
|
|
*root_x = tx;
|
|
|
|
if (root_y)
|
|
|
|
*root_y = ty;
|
1998-06-24 17:15:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return return_val;
|
1998-11-18 03:15:14 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_get_root_origin (GdkWindow *window,
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
gint *x,
|
|
|
|
gint *y)
|
2001-03-29 23:02:30 +00:00
|
|
|
{
|
|
|
|
GdkRectangle rect;
|
|
|
|
|
|
|
|
gdk_window_get_frame_extents (window, &rect);
|
|
|
|
|
|
|
|
if (x)
|
|
|
|
*x = rect.x;
|
|
|
|
|
|
|
|
if (y)
|
|
|
|
*y = rect.y;
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_get_frame_extents (GdkWindow *window,
|
2010-12-15 07:05:05 +00:00
|
|
|
GdkRectangle *rect)
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
{
|
2005-01-19 19:53:12 +00:00
|
|
|
GdkDisplay *display;
|
2009-11-27 23:17:33 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
Window xwindow;
|
|
|
|
Window xparent;
|
|
|
|
Window root;
|
2008-06-06 20:57:50 +00:00
|
|
|
Window child;
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
Window *children;
|
2005-01-20 01:19:45 +00:00
|
|
|
guchar *data;
|
2005-01-19 19:53:12 +00:00
|
|
|
Window *vroots;
|
|
|
|
Atom type_return;
|
2005-01-20 02:58:03 +00:00
|
|
|
guint nchildren;
|
|
|
|
guint nvroots;
|
|
|
|
gulong nitems_return;
|
|
|
|
gulong bytes_after_return;
|
|
|
|
gint format_return;
|
|
|
|
gint i;
|
|
|
|
guint ww, wh, wb, wd;
|
|
|
|
gint wx, wy;
|
2008-05-25 23:14:39 +00:00
|
|
|
gboolean got_frame_extents = FALSE;
|
2010-12-15 07:05:05 +00:00
|
|
|
|
2001-03-29 23:02:30 +00:00
|
|
|
g_return_if_fail (rect != NULL);
|
2010-12-15 07:05:05 +00:00
|
|
|
|
2001-03-29 23:02:30 +00:00
|
|
|
rect->x = 0;
|
|
|
|
rect->y = 0;
|
|
|
|
rect->width = 1;
|
|
|
|
rect->height = 1;
|
2010-12-15 07:05:05 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
while (window->parent && (window->parent)->parent)
|
|
|
|
window = window->parent;
|
2002-12-15 03:28:44 +00:00
|
|
|
|
|
|
|
/* Refine our fallback answer a bit using local information */
|
2010-11-22 23:55:39 +00:00
|
|
|
rect->x = window->x;
|
|
|
|
rect->y = window->y;
|
|
|
|
rect->width = window->width;
|
|
|
|
rect->height = window->height;
|
2002-12-15 03:28:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
|
|
|
if (GDK_WINDOW_DESTROYED (window) || impl->override_redirect)
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
return;
|
2002-12-15 03:28:44 +00:00
|
|
|
|
2008-05-25 23:14:39 +00:00
|
|
|
nvroots = 0;
|
|
|
|
vroots = NULL;
|
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2010-12-15 07:05:05 +00:00
|
|
|
|
|
|
|
gdk_x11_display_error_trap_push (display);
|
|
|
|
|
2008-05-25 23:14:39 +00:00
|
|
|
xwindow = GDK_WINDOW_XID (window);
|
2005-01-20 02:58:03 +00:00
|
|
|
|
2008-05-25 23:14:39 +00:00
|
|
|
/* first try: use _NET_FRAME_EXTENTS */
|
2013-01-10 04:40:04 +00:00
|
|
|
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,
|
2010-12-15 07:05:05 +00:00
|
|
|
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)
|
2008-05-25 23:14:39 +00:00
|
|
|
== Success)
|
|
|
|
{
|
|
|
|
if ((type_return == XA_CARDINAL) && (format_return == 32) &&
|
|
|
|
(nitems_return == 4) && (data))
|
|
|
|
{
|
2008-06-06 20:57:50 +00:00
|
|
|
gulong *ldata = (gulong *) data;
|
2008-05-25 23:14:39 +00:00
|
|
|
got_frame_extents = TRUE;
|
|
|
|
|
|
|
|
/* try to get the real client window geometry */
|
|
|
|
if (XGetGeometry (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
2008-06-06 20:57:50 +00:00
|
|
|
&root, &wx, &wy, &ww, &wh, &wb, &wd) &&
|
|
|
|
XTranslateCoordinates (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
xwindow, root, 0, 0, &wx, &wy, &child))
|
|
|
|
{
|
2008-05-25 23:14:39 +00:00
|
|
|
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);
|
2005-01-20 02:58:03 +00:00
|
|
|
|
2013-01-10 04:40:04 +00:00
|
|
|
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,
|
2005-01-19 19:53:12 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
"_NET_VIRTUAL_ROOTS"),
|
2005-01-20 02:58:03 +00:00
|
|
|
0, G_MAXLONG, False, XA_WINDOW, &type_return,
|
2005-01-19 19:53:12 +00:00
|
|
|
&format_return, &nitems_return, &bytes_after_return,
|
2005-01-20 01:19:45 +00:00
|
|
|
&data)
|
2005-01-19 19:53:12 +00:00
|
|
|
== Success)
|
|
|
|
{
|
2005-01-20 01:19:45 +00:00
|
|
|
if ((type_return == XA_WINDOW) && (format_return == 32) && (data))
|
|
|
|
{
|
|
|
|
nvroots = nitems_return;
|
|
|
|
vroots = (Window *)data;
|
|
|
|
}
|
2005-01-19 19:53:12 +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
|
|
|
xparent = GDK_WINDOW_XID (window);
|
2005-01-20 02:58:03 +00:00
|
|
|
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
do
|
|
|
|
{
|
|
|
|
xwindow = xparent;
|
2005-01-20 02:58:03 +00:00
|
|
|
|
|
|
|
if (!XQueryTree (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
&root, &xparent,
|
|
|
|
&children, &nchildren))
|
2008-05-25 23:14:39 +00:00
|
|
|
goto out;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
if (children)
|
|
|
|
XFree (children);
|
2005-01-19 19:53:12 +00:00
|
|
|
|
|
|
|
/* check virtual roots */
|
|
|
|
for (i = 0; i < nvroots; i++)
|
|
|
|
{
|
|
|
|
if (xparent == vroots[i])
|
|
|
|
{
|
|
|
|
root = xparent;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
}
|
|
|
|
while (xparent != root);
|
2010-12-15 07:05:05 +00:00
|
|
|
|
|
|
|
if (XGetGeometry (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
2005-01-19 19:53:12 +00:00
|
|
|
&root, &wx, &wy, &ww, &wh, &wb, &wd))
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
{
|
2005-01-19 19:53:12 +00:00
|
|
|
rect->x = wx;
|
|
|
|
rect->y = wy;
|
|
|
|
rect->width = ww;
|
|
|
|
rect->height = wh;
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
}
|
2002-12-15 03:28:44 +00:00
|
|
|
|
2008-05-25 23:14:39 +00:00
|
|
|
out:
|
2005-01-19 19:53:12 +00:00
|
|
|
if (vroots)
|
|
|
|
XFree (vroots);
|
|
|
|
|
2010-12-15 07:05:05 +00:00
|
|
|
gdk_x11_display_error_trap_pop_ignored (display);
|
new function to get the *real* geometry position of a window, taken
Sat Sep 25 23:33:55 1998 Tim Janik <timj@gtk.org>
* gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get
the *real* geometry position of a window, taken possible window
manager offsets into account.
this has been succesfully tested with fvwm, fvwm-2, bowman, olwm,
olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment.
it does fail though for amiwm which adds windows to a pseudo root
window, and for icewm by a small offset because it defines the
geometry position whithin its border.
* gtk/testgtk.c: added "saved position" test to figure how
gdk_window_get_root_origin() interacts with window managers (repopup
this window to figure ;).
1998-09-25 23:04:32 +00:00
|
|
|
}
|
|
|
|
|
2009-06-04 17:21:20 +00:00
|
|
|
static gboolean
|
2010-05-25 22:38:44 +00:00
|
|
|
gdk_window_x11_get_device_state (GdkWindow *window,
|
|
|
|
GdkDevice *device,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-12-13 22:43:10 +00:00
|
|
|
GdkWindow *child;
|
1999-10-03 22:12:41 +00:00
|
|
|
|
2009-06-04 17:21:20 +00:00
|
|
|
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE);
|
|
|
|
|
2010-12-13 22:43:10 +00:00
|
|
|
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
|
|
|
|
2010-12-13 22:43:10 +00:00
|
|
|
GDK_DEVICE_GET_CLASS (device)->query_state (device, window,
|
|
|
|
NULL, &child,
|
|
|
|
NULL, NULL,
|
|
|
|
x, y, mask);
|
|
|
|
return child != NULL;
|
1998-06-17 08:48:22 +00:00
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static GdkEventMask
|
|
|
|
gdk_window_x11_get_events (GdkWindow *window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
XWindowAttributes attrs;
|
|
|
|
GdkEventMask event_mask;
|
2009-05-10 06:08:41 +00:00
|
|
|
GdkEventMask filtered;
|
1999-10-03 22:12:41 +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))
|
1998-01-26 01:20:14 +00:00
|
|
|
return 0;
|
1999-10-03 22:12:41 +00:00
|
|
|
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),
|
2009-05-10 06:08:41 +00:00
|
|
|
GDK_WINDOW_XID (window),
|
1999-10-03 22:12:41 +00:00
|
|
|
&attrs);
|
2002-02-28 21:09:04 +00:00
|
|
|
event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
|
2009-05-10 06:08:41 +00:00
|
|
|
/* if property change was filtered out before, keep it filtered out */
|
|
|
|
filtered = GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK;
|
2010-11-22 23:55:39 +00:00
|
|
|
window->event_mask = event_mask & ((window->event_mask & filtered) | ~filtered);
|
2009-05-10 06:08:41 +00:00
|
|
|
|
1999-10-03 22:12:41 +00:00
|
|
|
return event_mask;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
|
|
|
gdk_window_x11_set_events (GdkWindow *window,
|
|
|
|
GdkEventMask event_mask)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2009-05-10 05:54:43 +00:00
|
|
|
long xevent_mask = 0;
|
1999-02-10 08:06:30 +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))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-12-20 16:14:04 +00:00
|
|
|
GdkX11Display *display_x11;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2009-05-10 05:54:43 +00:00
|
|
|
if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window))
|
|
|
|
xevent_mask = StructureNotifyMask | PropertyChangeMask;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2010-12-20 18:20:10 +00:00
|
|
|
display_x11 = GDK_X11_DISPLAY (gdk_window_get_display (window));
|
2010-12-15 17:25:38 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static inline void
|
2008-01-14 14:02:12 +00:00
|
|
|
do_shape_combine_region (GdkWindow *window,
|
2010-06-28 12:54:37 +00:00
|
|
|
const cairo_region_t *shape_region,
|
2008-01-14 14:02:12 +00:00
|
|
|
gint offset_x,
|
|
|
|
gint offset_y,
|
|
|
|
gint shape)
|
2006-02-20 01:36:50 +00:00
|
|
|
{
|
2001-03-02 20:02:17 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (shape_region == NULL)
|
|
|
|
{
|
|
|
|
/* Use NULL mask to unset the shape */
|
2008-12-17 09:53:21 +00:00
|
|
|
if (shape == ShapeBounding
|
|
|
|
? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
|
|
|
|
: gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
|
|
|
|
{
|
2009-01-20 20:59:04 +00:00
|
|
|
if (shape == ShapeBounding)
|
2009-01-27 15:43:03 +00:00
|
|
|
{
|
|
|
|
_gdk_x11_window_tmp_unset_parent_bg (window);
|
|
|
|
_gdk_x11_window_tmp_unset_bg (window, TRUE);
|
|
|
|
}
|
2008-12-17 09:53:21 +00:00
|
|
|
XShapeCombineMask (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
shape,
|
|
|
|
0, 0,
|
|
|
|
None,
|
|
|
|
ShapeSet);
|
2009-01-27 15:43:03 +00:00
|
|
|
if (shape == ShapeBounding)
|
|
|
|
{
|
|
|
|
_gdk_x11_window_tmp_reset_parent_bg (window);
|
|
|
|
_gdk_x11_window_tmp_reset_bg (window, TRUE);
|
|
|
|
}
|
2008-12-17 09:53:21 +00:00
|
|
|
}
|
2001-03-02 20:02:17 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-02-20 01:36:50 +00:00
|
|
|
if (shape == ShapeBounding
|
|
|
|
? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
|
|
|
|
: gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
|
2001-03-02 20:02:17 +00:00
|
|
|
{
|
|
|
|
gint n_rects = 0;
|
|
|
|
XRectangle *xrects = NULL;
|
|
|
|
|
2010-12-15 22:32:29 +00:00
|
|
|
_gdk_x11_region_get_xrectangles (shape_region,
|
|
|
|
0, 0,
|
|
|
|
&xrects, &n_rects);
|
2001-03-02 20:02:17 +00:00
|
|
|
|
2009-01-20 20:59:04 +00:00
|
|
|
if (shape == ShapeBounding)
|
2009-01-27 15:43:03 +00:00
|
|
|
{
|
|
|
|
_gdk_x11_window_tmp_unset_parent_bg (window);
|
|
|
|
_gdk_x11_window_tmp_unset_bg (window, TRUE);
|
|
|
|
}
|
2001-03-02 20:02:17 +00:00
|
|
|
XShapeCombineRectangles (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
2006-02-20 01:36:50 +00:00
|
|
|
shape,
|
2001-03-02 20:02:17 +00:00
|
|
|
offset_x, offset_y,
|
|
|
|
xrects, n_rects,
|
|
|
|
ShapeSet,
|
|
|
|
YXBanded);
|
|
|
|
|
2009-01-20 20:59:04 +00:00
|
|
|
if (shape == ShapeBounding)
|
2009-01-27 15:43:03 +00:00
|
|
|
{
|
|
|
|
_gdk_x11_window_tmp_reset_parent_bg (window);
|
|
|
|
_gdk_x11_window_tmp_reset_bg (window, TRUE);
|
|
|
|
}
|
2009-01-14 20:20:26 +00:00
|
|
|
|
2001-03-02 20:02:17 +00:00
|
|
|
g_free (xrects);
|
|
|
|
}
|
|
|
|
}
|
2008-06-30 12:15:29 +00:00
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static void
|
|
|
|
gdk_window_x11_shape_combine_region (GdkWindow *window,
|
2010-06-28 12:54:37 +00:00
|
|
|
const cairo_region_t *shape_region,
|
2008-06-27 14:27:44 +00:00
|
|
|
gint offset_x,
|
|
|
|
gint offset_y)
|
2008-06-30 12:15:29 +00:00
|
|
|
{
|
2006-02-20 01:36:50 +00:00
|
|
|
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,
|
2010-06-28 12:54:37 +00:00
|
|
|
const cairo_region_t *shape_region,
|
2008-12-17 10:24:46 +00:00
|
|
|
gint offset_x,
|
|
|
|
gint offset_y)
|
2006-02-20 01:36:50 +00:00
|
|
|
{
|
|
|
|
#ifdef ShapeInput
|
|
|
|
do_shape_combine_region (window, shape_region, offset_x, offset_y, ShapeInput);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2001-03-02 20:02:17 +00:00
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_override_redirect (GdkWindow *window,
|
1999-02-10 08:06:30 +00:00
|
|
|
gboolean override_redirect)
|
1997-12-16 22:10:43 +00:00
|
|
|
{
|
|
|
|
XSetWindowAttributes attr;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window) &&
|
2009-08-07 16:00:10 +00:00
|
|
|
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
1999-10-03 22:12:41 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2004-07-09 21:27:09 +00:00
|
|
|
|
|
|
|
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),
|
1999-10-03 22:12:41 +00:00
|
|
|
CWOverrideRedirect,
|
|
|
|
&attr);
|
2004-07-09 21:27:09 +00:00
|
|
|
|
|
|
|
impl->override_redirect = attr.override_redirect;
|
1999-10-03 22:12:41 +00:00
|
|
|
}
|
1997-12-16 22:10:43 +00:00
|
|
|
}
|
1998-02-27 03:55:33 +00:00
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_accept_focus (GdkWindow *window,
|
|
|
|
gboolean accept_focus)
|
2003-12-10 23:58:23 +00:00
|
|
|
{
|
|
|
|
accept_focus = accept_focus != FALSE;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->accept_focus != accept_focus)
|
2003-12-10 23:58:23 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
window->accept_focus = accept_focus;
|
2003-12-10 23:58:23 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window) &&
|
2009-08-07 16:00:10 +00:00
|
|
|
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2003-12-10 23:58:23 +00:00
|
|
|
update_wm_hints (window, FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_focus_on_map (GdkWindow *window,
|
|
|
|
gboolean focus_on_map)
|
2004-05-06 02:57:01 +00:00
|
|
|
{
|
|
|
|
focus_on_map = focus_on_map != FALSE;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->focus_on_map != focus_on_map)
|
2004-05-06 02:57:01 +00:00
|
|
|
{
|
2010-11-22 23:55:39 +00:00
|
|
|
window->focus_on_map = focus_on_map;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
if ((!GDK_WINDOW_DESTROYED (window)) &&
|
2010-11-22 23:55:39 +00:00
|
|
|
(!window->focus_on_map) &&
|
2009-08-07 16:00:10 +00:00
|
|
|
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2004-05-06 02:57:01 +00:00
|
|
|
gdk_x11_window_set_user_time (window, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_x11_window_set_user_time:
|
2011-07-28 11:27:23 +00:00
|
|
|
* @window: (type GdkX11Window): A toplevel #GdkWindow
|
2004-04-18 14:33:07 +00:00
|
|
|
* @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.
|
2004-05-06 02:57:01 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
2004-04-18 14:33:07 +00:00
|
|
|
**/
|
|
|
|
void
|
2004-05-06 02:57:01 +00:00
|
|
|
gdk_x11_window_set_user_time (GdkWindow *window,
|
|
|
|
guint32 timestamp)
|
2004-04-18 14:33:07 +00:00
|
|
|
{
|
|
|
|
GdkDisplay *display;
|
2010-12-20 16:14:04 +00:00
|
|
|
GdkX11Display *display_x11;
|
2004-08-23 17:10:34 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
2004-07-07 02:59:47 +00:00
|
|
|
glong timestamp_long = (glong)timestamp;
|
2007-04-01 03:38:34 +00:00
|
|
|
Window xid;
|
2004-04-18 14:33:07 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2004-04-18 14:33:07 +00:00
|
|
|
return;
|
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2010-12-20 18:20:10 +00:00
|
|
|
display_x11 = GDK_X11_DISPLAY (display);
|
2004-08-23 17:10:34 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
2004-04-18 14:33:07 +00:00
|
|
|
|
2007-04-01 03:38:34 +00:00
|
|
|
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,
|
2004-04-18 14:33:07 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
|
|
|
|
XA_CARDINAL, 32, PropModeReplace,
|
2004-07-07 02:59:47 +00:00
|
|
|
(guchar *)×tamp_long, 1);
|
2004-04-18 14:33:07 +00:00
|
|
|
|
2009-04-07 13:37:40 +00:00
|
|
|
if (timestamp_long != GDK_CURRENT_TIME &&
|
|
|
|
(display_x11->user_time == GDK_CURRENT_TIME ||
|
|
|
|
XSERVER_TIME_IS_LATER (timestamp_long, display_x11->user_time)))
|
2004-07-07 02:59:47 +00:00
|
|
|
display_x11->user_time = timestamp_long;
|
2004-08-23 17:10:34 +00:00
|
|
|
|
2007-01-30 18:36:44 +00:00
|
|
|
if (toplevel)
|
|
|
|
toplevel->user_time = timestamp_long;
|
2004-04-18 14:33:07 +00:00
|
|
|
}
|
2001-03-05 15:09:02 +00:00
|
|
|
|
2011-03-20 13:37:27 +00:00
|
|
|
/**
|
2011-11-25 22:21:05 +00:00
|
|
|
* gdk_x11_window_set_utf8_property:
|
2011-07-28 11:27:23 +00:00
|
|
|
* @window: (type GdkX11Window): a #GdkWindow
|
2011-11-25 22:21:05 +00:00
|
|
|
* @name: Property name, will be interned as an X atom
|
|
|
|
* @value: (allow-none): Property value, or %NULL to delete
|
2011-03-20 13:37:27 +00:00
|
|
|
*
|
2011-11-25 22:21:05 +00:00
|
|
|
* 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.
|
2012-01-12 04:11:49 +00:00
|
|
|
*
|
|
|
|
* Since: 3.4
|
2011-03-20 13:37:27 +00:00
|
|
|
*/
|
|
|
|
void
|
2011-11-25 22:21:05 +00:00
|
|
|
gdk_x11_window_set_utf8_property (GdkWindow *window,
|
|
|
|
const gchar *name,
|
|
|
|
const gchar *value)
|
2011-03-20 13:37:27 +00:00
|
|
|
{
|
2011-04-03 21:40:37 +00:00
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
|
|
if (!WINDOW_IS_TOPLEVEL (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
display = gdk_window_get_display (window);
|
2011-03-20 13:37:27 +00:00
|
|
|
|
2011-11-25 22:21:05 +00:00
|
|
|
if (value != NULL)
|
2011-03-20 13:37:27 +00:00
|
|
|
{
|
|
|
|
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
GDK_WINDOW_XID (window),
|
2011-11-25 22:21:05 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, name),
|
2011-03-20 13:37:27 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
|
2011-11-25 22:21:05 +00:00
|
|
|
PropModeReplace, (guchar *)value, strlen (value));
|
2011-03-20 13:37:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
GDK_WINDOW_XID (window),
|
2011-11-25 22:21:05 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, name));
|
2011-03-20 13:37:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-03 00:47:25 +00:00
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
{
|
|
|
|
guint32 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"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-25 22:21:05 +00:00
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
{
|
|
|
|
return gdk_x11_window_set_utf8_property (window, "_GTK_THEME_VARIANT", variant);
|
|
|
|
}
|
|
|
|
|
2005-11-08 18:26:37 +00:00
|
|
|
#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)
|
|
|
|
|
2010-08-12 02:21:49 +00:00
|
|
|
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)
|
|
|
|
{
|
2010-08-27 10:08:30 +00:00
|
|
|
cairo_surface_destroy (toplevel->icon_pixmap);
|
2010-08-12 02:21:49 +00:00
|
|
|
toplevel->icon_pixmap = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (toplevel->icon_mask != NULL)
|
|
|
|
{
|
2010-08-27 10:08:30 +00:00
|
|
|
cairo_surface_destroy (toplevel->icon_mask);
|
2010-08-12 02:21:49 +00:00
|
|
|
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)
|
2010-08-27 10:08:30 +00:00
|
|
|
{
|
|
|
|
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))
|
|
|
|
{
|
2010-08-27 13:09:49 +00:00
|
|
|
toplevel->icon_mask = _gdk_x11_window_create_bitmap_surface (window,
|
|
|
|
width,
|
|
|
|
height);
|
2010-08-27 10:08:30 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-12 02:21:49 +00:00
|
|
|
update_wm_hints (window, FALSE);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_icon_list (GdkWindow *window,
|
|
|
|
GList *pixbufs)
|
2001-03-05 15:09:02 +00:00
|
|
|
{
|
2001-10-26 23:43:32 +00:00
|
|
|
gulong *data;
|
2001-03-05 15:09:02 +00:00
|
|
|
guchar *pixels;
|
2001-10-26 23:43:32 +00:00
|
|
|
gulong *p;
|
2001-03-05 15:09:02 +00:00
|
|
|
gint size;
|
|
|
|
GList *l;
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
gint width, height, stride;
|
|
|
|
gint x, y;
|
|
|
|
gint n_channels;
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
2005-11-08 18:26:37 +00:00
|
|
|
gint n;
|
2001-03-05 15:09:02 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-08-29 02:20:02 +00:00
|
|
|
return;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2001-03-05 15:09:02 +00:00
|
|
|
|
|
|
|
l = pixbufs;
|
|
|
|
size = 0;
|
2005-11-08 18:26:37 +00:00
|
|
|
n = 0;
|
2001-03-05 15:09:02 +00:00
|
|
|
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));
|
2001-03-05 15:09:02 +00:00
|
|
|
|
|
|
|
width = gdk_pixbuf_get_width (pixbuf);
|
|
|
|
height = gdk_pixbuf_get_height (pixbuf);
|
|
|
|
|
2005-11-08 18:26:37 +00:00
|
|
|
/* silently ignore overlarge icons */
|
|
|
|
if (size + 2 + width * height > GDK_SELECTION_MAX_SIZE(display))
|
|
|
|
{
|
|
|
|
g_warning ("gdk_window_set_icon_list: icons too large");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
n++;
|
2001-03-05 15:09:02 +00:00
|
|
|
size += 2 + width * height;
|
2005-11-08 18:26:37 +00:00
|
|
|
|
2001-03-05 15:09:02 +00:00
|
|
|
l = g_list_next (l);
|
|
|
|
}
|
|
|
|
|
2001-10-26 23:43:32 +00:00
|
|
|
data = g_malloc (size * sizeof (gulong));
|
2001-03-05 15:09:02 +00:00
|
|
|
|
|
|
|
l = pixbufs;
|
|
|
|
p = data;
|
2005-11-08 18:26:37 +00:00
|
|
|
while (l && n > 0)
|
2001-03-05 15:09:02 +00:00
|
|
|
{
|
|
|
|
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);
|
2005-11-08 18:26:37 +00:00
|
|
|
n--;
|
2001-03-05 15:09:02 +00:00
|
|
|
}
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
if (size > 0)
|
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
|
2001-08-29 02:20:02 +00:00
|
|
|
GDK_WINDOW_XID (window),
|
2002-04-25 22:29:14 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON"),
|
2001-08-29 02:20:02 +00:00
|
|
|
XA_CARDINAL, 32,
|
|
|
|
PropModeReplace,
|
|
|
|
(guchar*) data, size);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
|
2001-08-29 02:20:02 +00:00
|
|
|
GDK_WINDOW_XID (window),
|
2002-04-25 22:29:14 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON"));
|
2001-08-29 02:20:02 +00:00
|
|
|
}
|
2001-11-25 22:19:22 +00:00
|
|
|
|
|
|
|
g_free (data);
|
2010-08-12 02:21:49 +00:00
|
|
|
|
|
|
|
gdk_window_update_icon (window, pixbufs);
|
2001-03-05 15:09:02 +00:00
|
|
|
}
|
|
|
|
|
2000-10-04 16:51:42 +00:00
|
|
|
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")));
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_icon_name (GdkWindow *window,
|
|
|
|
const gchar *name)
|
1998-02-27 03:55:33 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
2009-04-20 12:53:51 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2010-03-12 20:52:36 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
1998-02-27 03:55:33 +00:00
|
|
|
return;
|
2000-10-04 16:51:42 +00:00
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2000-10-04 16:51:42 +00:00
|
|
|
g_object_set_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"),
|
2009-04-20 12:53:51 +00:00
|
|
|
GUINT_TO_POINTER (name != NULL));
|
2000-10-04 16:51:42 +00:00
|
|
|
|
2009-04-20 12:53:51 +00:00
|
|
|
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"));
|
|
|
|
}
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
2000-10-04 16:51:42 +00:00
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_iconify (GdkWindow *window)
|
2000-10-04 16:51:42 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-02-27 20:40:15 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
XIconifyWindow (GDK_WINDOW_XDISPLAY (window),
|
2010-11-22 16:06:46 +00:00
|
|
|
GDK_WINDOW_XID (window),
|
2002-04-25 22:29:14 +00:00
|
|
|
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)));
|
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);
|
2012-02-21 16:14:16 +00:00
|
|
|
gdk_wmspec_change_state (TRUE, window,
|
|
|
|
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
|
|
|
|
GDK_NONE);
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_deiconify (GdkWindow *window)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2000-10-04 16:51:42 +00:00
|
|
|
return;
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
{
|
|
|
|
gdk_window_show (window);
|
2012-02-21 16:14:16 +00:00
|
|
|
gdk_wmspec_change_state (FALSE, window,
|
|
|
|
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
|
|
|
|
GDK_NONE);
|
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);
|
2012-02-21 16:14:16 +00:00
|
|
|
gdk_wmspec_change_state (FALSE, window,
|
|
|
|
gdk_atom_intern_static_string ("_NET_WM_STATE_HIDDEN"),
|
|
|
|
GDK_NONE);
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_stick (GdkWindow *window)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
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.
|
|
|
|
*/
|
|
|
|
|
2007-01-04 01:28:07 +00:00
|
|
|
XClientMessageEvent xclient;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
|
|
|
/* Request stick during viewport scroll */
|
2001-03-05 15:09:02 +00:00
|
|
|
gdk_wmspec_change_state (TRUE, window,
|
2005-09-11 05:40:51 +00:00
|
|
|
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
|
2009-06-06 03:06:12 +00:00
|
|
|
GDK_NONE);
|
2001-02-27 20:40:15 +00:00
|
|
|
|
|
|
|
/* Request desktop 0xFFFFFFFF */
|
2007-01-04 01:28:07 +00:00
|
|
|
memset (&xclient, 0, sizeof (xclient));
|
|
|
|
xclient.type = ClientMessage;
|
2010-11-22 16:06:46 +00:00
|
|
|
xclient.window = GDK_WINDOW_XID (window);
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.display = GDK_WINDOW_XDISPLAY (window);
|
|
|
|
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window),
|
2002-04-25 22:29:14 +00:00
|
|
|
"_NET_WM_DESKTOP");
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.format = 32;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2007-01-04 01:28:07 +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;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False,
|
2001-02-27 20:40:15 +00:00
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
2007-01-04 01:28:07 +00:00
|
|
|
(XEvent *)&xclient);
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_unstick (GdkWindow *window)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-02-27 20:40:15 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
{
|
|
|
|
/* Request unstick from viewport */
|
2001-03-05 15:09:02 +00:00
|
|
|
gdk_wmspec_change_state (FALSE, window,
|
2005-09-11 05:40:51 +00:00
|
|
|
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
|
2009-06-06 03:06:12 +00:00
|
|
|
GDK_NONE);
|
2001-02-27 20:40:15 +00:00
|
|
|
|
2006-05-25 05:30:14 +00:00
|
|
|
move_to_current_desktop (window);
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_maximize (GdkWindow *window)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-02-27 20:40:15 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
2001-03-05 15:09:02 +00:00
|
|
|
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"));
|
2001-02-27 20:40:15 +00:00
|
|
|
else
|
2001-03-05 15:09:02 +00:00
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
0,
|
|
|
|
GDK_WINDOW_STATE_MAXIMIZED);
|
2001-02-27 20:40:15 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_unmaximize (GdkWindow *window)
|
2001-02-27 20:40:15 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-02-27 20:40:15 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
2001-03-05 15:09:02 +00:00
|
|
|
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"));
|
2001-02-27 20:40:15 +00:00
|
|
|
else
|
2001-03-05 15:09:02 +00:00
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
GDK_WINDOW_STATE_MAXIMIZED,
|
|
|
|
0);
|
1998-02-27 03:55:33 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
2013-01-21 10:52:32 +00:00
|
|
|
gdk_x11_window_apply_fullscreen_mode (GdkWindow *window)
|
2002-09-25 19:16:46 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2002-09-25 19:16:46 +00:00
|
|
|
return;
|
|
|
|
|
2013-01-21 10:52:32 +00:00
|
|
|
/* _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.
|
|
|
|
*/
|
|
|
|
|
2002-09-25 19:16:46 +00:00
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
2013-01-21 10:52:32 +00:00
|
|
|
{
|
|
|
|
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;
|
2002-09-25 19:16:46 +00:00
|
|
|
|
2013-01-21 10:52:32 +00:00
|
|
|
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);
|
|
|
|
}
|
2002-09-25 19:16:46 +00:00
|
|
|
else
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
0,
|
|
|
|
GDK_WINDOW_STATE_FULLSCREEN);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_unfullscreen (GdkWindow *window)
|
2002-09-25 19:16:46 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2002-09-25 19:16:46 +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_FULLSCREEN"),
|
2002-09-25 19:16:46 +00:00
|
|
|
GDK_NONE);
|
|
|
|
|
|
|
|
else
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
GDK_WINDOW_STATE_FULLSCREEN,
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_keep_above (GdkWindow *window,
|
|
|
|
gboolean setting)
|
2003-08-10 23:37:37 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2003-08-10 23:37:37 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
2004-07-31 04:45:09 +00:00
|
|
|
{
|
|
|
|
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"),
|
2004-07-31 04:45:09 +00:00
|
|
|
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"),
|
2004-07-31 04:45:09 +00:00
|
|
|
GDK_NONE);
|
|
|
|
}
|
2003-08-10 23:37:37 +00:00
|
|
|
else
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
|
|
|
|
setting ? GDK_WINDOW_STATE_ABOVE : 0);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_keep_below (GdkWindow *window, gboolean setting)
|
2003-08-10 23:37:37 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2003-08-10 23:37:37 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
2004-07-31 04:45:09 +00:00
|
|
|
{
|
|
|
|
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"),
|
2004-07-31 04:45:09 +00:00
|
|
|
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"),
|
2004-07-31 04:45:09 +00:00
|
|
|
GDK_NONE);
|
|
|
|
}
|
2003-08-10 23:37:37 +00:00
|
|
|
else
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
|
|
|
|
setting ? GDK_WINDOW_STATE_BELOW : 0);
|
|
|
|
}
|
2002-09-25 19:16:46 +00:00
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static GdkWindow *
|
|
|
|
gdk_x11_window_get_group (GdkWindow *window)
|
2003-12-09 23:12:53 +00:00
|
|
|
{
|
|
|
|
GdkToplevelX11 *toplevel;
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
|
|
|
!WINDOW_IS_TOPLEVEL (window))
|
2003-12-09 23:12:53 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
|
|
|
|
return toplevel->group_leader;
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_group (GdkWindow *window,
|
|
|
|
GdkWindow *leader)
|
1998-02-27 03:55:33 +00:00
|
|
|
{
|
2003-07-05 02:34:52 +00:00
|
|
|
GdkToplevelX11 *toplevel;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2008-12-19 10:07:09 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
2003-07-05 02:34:52 +00:00
|
|
|
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
|
2008-12-19 10:07:09 +00:00
|
|
|
g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader));
|
2003-12-09 23:12:53 +00:00
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
|
|
|
(leader != NULL && GDK_WINDOW_DESTROYED (leader)) ||
|
|
|
|
!WINDOW_IS_TOPLEVEL (window))
|
2003-12-09 23:12:53 +00:00
|
|
|
return;
|
1999-10-03 22:12:41 +00:00
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
|
2009-08-07 16:00:10 +00:00
|
|
|
if (leader == NULL)
|
2010-08-29 00:08:47 +00:00
|
|
|
leader = gdk_display_get_default_group (gdk_window_get_display (window));
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2003-07-05 02:34:52 +00:00
|
|
|
if (toplevel->group_leader != leader)
|
2003-07-05 01:54:05 +00:00
|
|
|
{
|
2003-07-05 02:34:52 +00:00
|
|
|
if (toplevel->group_leader)
|
|
|
|
g_object_unref (toplevel->group_leader);
|
2003-10-23 18:50:40 +00:00
|
|
|
toplevel->group_leader = g_object_ref (leader);
|
2004-10-18 21:02:37 +00:00
|
|
|
(_gdk_x11_window_get_toplevel (leader))->is_leader = TRUE;
|
2003-07-05 01:54:05 +00:00
|
|
|
}
|
1999-02-10 15:45:19 +00:00
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
update_wm_hints (window, FALSE);
|
1998-02-27 03:55:33 +00:00
|
|
|
}
|
|
|
|
|
2001-01-08 16:42:08 +00:00
|
|
|
static MotifWmHints *
|
|
|
|
gdk_window_get_mwm_hints (GdkWindow *window)
|
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
|
|
|
Atom hints_atom = None;
|
2004-11-17 00:55:10 +00:00
|
|
|
guchar *data;
|
2001-01-08 16:42:08 +00:00
|
|
|
Atom type;
|
|
|
|
gint format;
|
|
|
|
gulong nitems;
|
|
|
|
gulong bytes_after;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return NULL;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2001-01-08 16:42:08 +00:00
|
|
|
|
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),
|
2001-01-08 16:42:08 +00:00
|
|
|
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
|
|
|
|
False, AnyPropertyType, &type, &format, &nitems,
|
2004-11-17 00:55:10 +00:00
|
|
|
&bytes_after, &data);
|
2001-01-08 16:42:08 +00:00
|
|
|
|
|
|
|
if (type == None)
|
|
|
|
return NULL;
|
|
|
|
|
2004-11-17 00:55:10 +00:00
|
|
|
return (MotifWmHints *)data;
|
2001-01-08 16:42:08 +00:00
|
|
|
}
|
|
|
|
|
1998-02-27 03:55:33 +00:00
|
|
|
static void
|
|
|
|
gdk_window_set_mwm_hints (GdkWindow *window,
|
|
|
|
MotifWmHints *new_hints)
|
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
|
|
|
Atom hints_atom = None;
|
2004-11-17 00:55:10 +00:00
|
|
|
guchar *data;
|
1998-02-27 03:55:33 +00:00
|
|
|
MotifWmHints *hints;
|
|
|
|
Atom type;
|
|
|
|
gint format;
|
|
|
|
gulong nitems;
|
|
|
|
gulong bytes_after;
|
1999-02-10 08:06:30 +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))
|
1998-02-27 03:55:33 +00:00
|
|
|
return;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
1998-02-27 03:55:33 +00:00
|
|
|
|
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),
|
1999-02-21 20:55:04 +00:00
|
|
|
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
|
1998-02-27 03:55:33 +00:00
|
|
|
False, AnyPropertyType, &type, &format, &nitems,
|
2004-11-17 00:55:10 +00:00
|
|
|
&bytes_after, &data);
|
1999-02-10 08:06:30 +00:00
|
|
|
|
1998-02-27 03:55:33 +00:00
|
|
|
if (type == None)
|
|
|
|
hints = new_hints;
|
|
|
|
else
|
|
|
|
{
|
2004-11-17 00:55:10 +00:00
|
|
|
hints = (MotifWmHints *)data;
|
|
|
|
|
1998-02-27 03:55:33 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
1999-02-10 08:06:30 +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
|
|
|
XChangeProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
|
1998-02-27 03:55:33 +00:00
|
|
|
hints_atom, hints_atom, 32, PropModeReplace,
|
1999-02-21 20:55:04 +00:00
|
|
|
(guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
|
1999-02-10 08:06:30 +00:00
|
|
|
|
1998-02-27 03:55:33 +00:00
|
|
|
if (hints != new_hints)
|
|
|
|
XFree (hints);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_decorations (GdkWindow *window,
|
|
|
|
GdkWMDecoration decorations)
|
1998-02-27 03:55:33 +00:00
|
|
|
{
|
|
|
|
MotifWmHints hints;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2008-07-18 13:03:42 +00:00
|
|
|
return;
|
1999-10-03 22:12:41 +00:00
|
|
|
|
2006-08-15 05:46:08 +00:00
|
|
|
/* initialize to zero to avoid writing uninitialized data to socket */
|
|
|
|
memset(&hints, 0, sizeof(hints));
|
1998-02-27 03:55:33 +00:00
|
|
|
hints.flags = MWM_HINTS_DECORATIONS;
|
|
|
|
hints.decorations = decorations;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
1998-02-27 03:55:33 +00:00
|
|
|
gdk_window_set_mwm_hints (window, &hints);
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static gboolean
|
|
|
|
gdk_x11_window_get_decorations(GdkWindow *window,
|
|
|
|
GdkWMDecoration *decorations)
|
2001-01-08 16:42:08 +00:00
|
|
|
{
|
|
|
|
MotifWmHints *hints;
|
|
|
|
gboolean result = FALSE;
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2008-07-18 13:03:42 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2001-01-08 16:42:08 +00:00
|
|
|
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;
|
2001-01-08 16:42:08 +00:00
|
|
|
result = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
XFree (hints);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_functions (GdkWindow *window,
|
1998-02-27 03:55:33 +00:00
|
|
|
GdkWMFunction functions)
|
|
|
|
{
|
|
|
|
MotifWmHints hints;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
1999-10-03 22:12:41 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2008-07-18 13:03:42 +00:00
|
|
|
return;
|
1999-10-03 22:12:41 +00:00
|
|
|
|
2006-08-15 05:46:08 +00:00
|
|
|
/* initialize to zero to avoid writing uninitialized data to socket */
|
|
|
|
memset(&hints, 0, sizeof(hints));
|
1998-02-27 03:55:33 +00:00
|
|
|
hints.flags = MWM_HINTS_FUNCTIONS;
|
|
|
|
hints.functions = functions;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
1998-02-27 03:55:33 +00:00
|
|
|
gdk_window_set_mwm_hints (window, &hints);
|
|
|
|
}
|
1998-05-01 16:15:39 +00:00
|
|
|
|
2010-06-28 12:54:37 +00:00
|
|
|
cairo_region_t *
|
2010-12-15 19:49:23 +00:00
|
|
|
_gdk_x11_xwindow_get_shape (Display *xdisplay,
|
|
|
|
Window window,
|
|
|
|
gint shape_type)
|
2008-12-16 13:38:10 +00:00
|
|
|
{
|
2010-06-28 12:54:37 +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;
|
2010-03-16 16:35:13 +00:00
|
|
|
rn = 0;
|
|
|
|
|
2012-01-03 15:51:13 +00:00
|
|
|
/* 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);
|
2010-03-16 16:35:13 +00:00
|
|
|
|
2012-01-03 15:51:13 +00:00
|
|
|
if (rn == 0)
|
2010-06-28 12:44:12 +00:00
|
|
|
return cairo_region_create (); /* Empty */
|
2010-03-16 16:35:13 +00:00
|
|
|
|
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
|
2012-01-03 15:51:13 +00:00
|
|
|
* 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
|
|
|
|
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;
|
|
|
|
rl[i].y = xrl[i].y;
|
|
|
|
rl[i].width = xrl[i].width;
|
|
|
|
rl[i].height = xrl[i].height;
|
2008-12-16 13:38:10 +00:00
|
|
|
}
|
2008-12-16 19:09:20 +00:00
|
|
|
XFree (xrl);
|
2012-01-03 15:51:13 +00:00
|
|
|
|
2010-06-28 12:31:10 +00:00
|
|
|
shape = cairo_region_create_rectangles (rl, rn);
|
2008-12-16 19:09:20 +00:00
|
|
|
g_free (rl);
|
2012-01-03 15:51:13 +00:00
|
|
|
|
2008-12-16 19:09:20 +00:00
|
|
|
return shape;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-25 11:17:11 +00:00
|
|
|
static cairo_region_t *
|
|
|
|
gdk_x11_window_get_shape (GdkWindow *window)
|
2008-12-16 19:09:20 +00:00
|
|
|
{
|
|
|
|
if (!GDK_WINDOW_DESTROYED (window) &&
|
|
|
|
gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)))
|
2010-12-15 19:49:23 +00:00
|
|
|
return _gdk_x11_xwindow_get_shape (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
ShapeBounding);
|
2008-12-16 19:09:20 +00:00
|
|
|
|
|
|
|
return NULL;
|
2008-12-16 13:38:10 +00:00
|
|
|
}
|
|
|
|
|
2010-11-25 11:17:11 +00:00
|
|
|
static cairo_region_t *
|
|
|
|
gdk_x11_window_get_input_shape (GdkWindow *window)
|
2008-06-27 14:27:44 +00:00
|
|
|
{
|
2009-06-06 03:06:12 +00:00
|
|
|
#if defined(ShapeInput)
|
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) &&
|
2012-01-03 15:51:13 +00:00
|
|
|
gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
|
2010-12-15 19:49:23 +00:00
|
|
|
return _gdk_x11_xwindow_get_shape (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
ShapeInput);
|
2008-06-27 14:27:44 +00:00
|
|
|
#endif
|
1998-11-06 22:05:02 +00:00
|
|
|
|
2008-12-17 10:24:46 +00:00
|
|
|
return NULL;
|
2006-02-20 01:36:50 +00:00
|
|
|
}
|
|
|
|
|
1999-01-27 18:21:20 +00:00
|
|
|
static void
|
2008-06-30 12:15:29 +00:00
|
|
|
gdk_window_set_static_bit_gravity (GdkWindow *window,
|
|
|
|
gboolean on)
|
1999-01-27 18:21:20 +00:00
|
|
|
{
|
|
|
|
XSetWindowAttributes xattributes;
|
2000-03-28 01:24:44 +00:00
|
|
|
guint xattributes_mask = 0;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2005-06-15 16:59:20 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
2002-03-16 23:30:44 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (window->input_only)
|
2002-03-16 23:30:44 +00:00
|
|
|
return;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2000-03-28 01:24:44 +00:00
|
|
|
xattributes.bit_gravity = StaticGravity;
|
|
|
|
xattributes_mask |= CWBitGravity;
|
1999-01-27 18:21:20 +00:00
|
|
|
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),
|
1999-01-27 18:21:20 +00:00
|
|
|
CWBitGravity, &xattributes);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-06-30 12:15:29 +00:00
|
|
|
gdk_window_set_static_win_gravity (GdkWindow *window,
|
|
|
|
gboolean on)
|
1999-01-27 18:21:20 +00:00
|
|
|
{
|
|
|
|
XSetWindowAttributes xattributes;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2005-06-15 16:59:20 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
1999-02-10 08:06:30 +00:00
|
|
|
|
1999-01-27 18:21:20 +00:00
|
|
|
xattributes.win_gravity = on ? StaticGravity : NorthWestGravity;
|
1999-02-10 08:06:30 +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
|
|
|
XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
GDK_WINDOW_XID (window),
|
1999-01-27 18:21:20 +00:00
|
|
|
CWWinGravity, &xattributes);
|
|
|
|
}
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
static gboolean
|
|
|
|
gdk_window_x11_set_static_gravities (GdkWindow *window,
|
|
|
|
gboolean use_static)
|
1999-01-27 18:21:20 +00:00
|
|
|
{
|
|
|
|
GList *tmp_list;
|
1999-02-10 08:06:30 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (!use_static == !window->guffaw_gravity)
|
1999-01-27 18:21:20 +00:00
|
|
|
return TRUE;
|
2004-02-02 18:18:18 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
window->guffaw_gravity = use_static;
|
1999-02-10 08:06:30 +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))
|
1999-01-27 18:21:20 +00:00
|
|
|
{
|
1999-10-03 22:12:41 +00:00
|
|
|
gdk_window_set_static_bit_gravity (window, use_static);
|
1999-01-27 18:21:20 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
tmp_list = window->children;
|
1999-10-03 22:12:41 +00:00
|
|
|
while (tmp_list)
|
|
|
|
{
|
2001-11-05 15:56:50 +00:00
|
|
|
gdk_window_set_static_win_gravity (tmp_list->data, use_static);
|
1999-10-03 22:12:41 +00:00
|
|
|
|
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
1999-01-27 18:21:20 +00:00
|
|
|
}
|
1999-02-10 08:06:30 +00:00
|
|
|
|
1999-01-27 18:21:20 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
1999-11-08 20:14:59 +00:00
|
|
|
|
2012-02-01 17:59:23 +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
|
2012-02-01 17:59:23 +00:00
|
|
|
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
|
|
|
{
|
2007-01-04 01:28:07 +00:00
|
|
|
XClientMessageEvent xclient;
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2007-01-04 01:28:07 +00:00
|
|
|
memset (&xclient, 0, sizeof (xclient));
|
|
|
|
xclient.type = ClientMessage;
|
|
|
|
xclient.window = GDK_WINDOW_XID (window);
|
|
|
|
xclient.message_type =
|
2002-04-25 22:29:14 +00:00
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_MOVERESIZE");
|
2007-01-04 01:28:07 +00:00
|
|
|
xclient.format = 32;
|
|
|
|
xclient.data.l[0] = root_x;
|
|
|
|
xclient.data.l[1] = root_y;
|
2012-02-01 17:59:23 +00:00
|
|
|
xclient.data.l[2] = action;
|
2011-12-28 16:16:54 +00:00
|
|
|
xclient.data.l[3] = button;
|
|
|
|
xclient.data.l[4] = 1; /* source indication */
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
|
2012-02-01 17:59:23 +00:00
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
|
|
|
(XEvent *)&xclient);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2012-04-04 13:54:32 +00:00
|
|
|
static void
|
2012-02-01 17:59:23 +00:00
|
|
|
handle_wmspec_button_release (GdkDisplay *display,
|
|
|
|
XEvent *xevent)
|
|
|
|
{
|
|
|
|
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
|
|
|
GdkWindow *window;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2012-02-01 17:59:23 +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)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
2012-02-01 17:59:23 +00:00
|
|
|
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2012-02-01 17:59:23 +00:00
|
|
|
/* Release passive grab */
|
|
|
|
gdk_device_ungrab (device, timestamp);
|
|
|
|
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,
|
2011-11-05 05:10:16 +00:00
|
|
|
GdkDevice *device,
|
2001-03-29 21:17:45 +00:00
|
|
|
gint button,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
|
|
|
gint direction;
|
|
|
|
|
|
|
|
/* Let the compiler turn a switch into a table, instead
|
|
|
|
* of doing the table manually, this way is easier to verify.
|
|
|
|
*/
|
|
|
|
switch (edge)
|
|
|
|
{
|
|
|
|
case GDK_WINDOW_EDGE_NORTH_WEST:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_TOPLEFT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_EDGE_NORTH:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_TOP;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_EDGE_NORTH_EAST:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_TOPRIGHT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_EDGE_WEST:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_LEFT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_EDGE_EAST:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_RIGHT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH_WEST:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOM;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH_EAST:
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_warning ("gdk_window_begin_resize_drag: bad resize edge %d!",
|
|
|
|
edge);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-12-28 16:16:54 +00:00
|
|
|
wmspec_moveresize (window, direction, device, button, root_x, root_y, timestamp);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2012-02-01 17:59:23 +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;
|
|
|
|
};
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
static MoveResizeData *
|
2002-06-18 15:45:05 +00:00
|
|
|
get_move_resize_data (GdkDisplay *display,
|
|
|
|
gboolean create)
|
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);
|
|
|
|
|
2002-06-18 15:45:05 +00:00
|
|
|
if (!mv_resize && create)
|
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
|
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;
|
|
|
|
|
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
|
|
|
{
|
2002-12-03 21:57:13 +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
|
|
|
|
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)
|
|
|
|
{
|
2002-12-03 21:57:13 +00:00
|
|
|
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;
|
2002-04-25 22:29:14 +00:00
|
|
|
case GDK_WINDOW_EDGE_SOUTH_EAST:
|
|
|
|
w += dx;
|
|
|
|
h += dy;
|
|
|
|
break;
|
2002-12-03 21:57:13 +00:00
|
|
|
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;
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2002-12-03 21:57:13 +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);
|
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);
|
|
|
|
}
|
|
|
|
|
2002-12-03 21:57:13 +00:00
|
|
|
gdk_window_move_resize (mv_resize->moveresize_window, x, y, w, h);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gint x, y;
|
|
|
|
|
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
|
2002-04-25 22:29:14 +00:00
|
|
|
finish_drag (MoveResizeData *mv_resize)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
gdk_window_destroy (mv_resize->moveresize_emulation_window);
|
|
|
|
mv_resize->moveresize_emulation_window = NULL;
|
2006-01-11 14:54:05 +00:00
|
|
|
g_object_unref (mv_resize->moveresize_window);
|
2002-04-25 22:29:14 +00:00
|
|
|
mv_resize->moveresize_window = NULL;
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
if (mv_resize->moveresize_pending_event)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
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
|
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;
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
|
2002-06-18 15:45:05 +00:00
|
|
|
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
|
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:
|
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
|
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;
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
if (mv_resize->moveresize_process_time)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
if (event->xmotion.time == mv_resize->moveresize_process_time)
|
2010-12-15 22:55:04 +00:00
|
|
|
{
|
|
|
|
mv_resize->moveresize_process_time = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2001-03-29 21:17:45 +00:00
|
|
|
else
|
2010-12-15 22:55:04 +00:00
|
|
|
return FALSE;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
XCheckIfEvent (event->xany.display, &tmp_event,
|
2010-12-15 22:55:04 +00:00
|
|
|
lookahead_motion_predicate, (XPointer) & seen_release);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
return mv_resize->moveresize_process_time == 0;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
2010-12-15 22:55:04 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
gboolean
|
2010-12-15 22:55:04 +00:00
|
|
|
_gdk_x11_moveresize_handle_event (XEvent *event)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
guint button_mask = 0;
|
2002-12-03 21:57:13 +00:00
|
|
|
GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display);
|
2002-06-18 15:45:05 +00:00
|
|
|
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-11-10 01:33:53 +00:00
|
|
|
if (!mv_resize || !mv_resize->moveresize_window)
|
2012-04-04 13:54:32 +00:00
|
|
|
{
|
|
|
|
handle_wmspec_button_release (display, event);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1);
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
switch (event->xany.type)
|
|
|
|
{
|
|
|
|
case MotionNotify:
|
2010-11-22 23:55:39 +00:00
|
|
|
if (mv_resize->moveresize_window->resize_count > 0)
|
2010-12-15 22:55:04 +00:00
|
|
|
{
|
|
|
|
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
|
|
|
|
2010-12-15 22:55:04 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-04-25 22:29:14 +00:00
|
|
|
if (!moveresize_lookahead (mv_resize, event))
|
2010-12-15 22:55:04 +00:00
|
|
|
break;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
update_pos (mv_resize,
|
2010-12-15 22:55:04 +00:00
|
|
|
event->xmotion.x_root,
|
|
|
|
event->xmotion.y_root);
|
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)
|
2010-12-15 22:55:04 +00:00
|
|
|
finish_drag (mv_resize);
|
2001-03-29 21:17:45 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ButtonRelease:
|
2002-04-25 22:29:14 +00:00
|
|
|
update_pos (mv_resize,
|
2010-12-15 22:55:04 +00:00
|
|
|
event->xbutton.x_root,
|
|
|
|
event->xbutton.y_root);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
if (event->xbutton.button == mv_resize->moveresize_button)
|
2010-12-15 22:55:04 +00:00
|
|
|
finish_drag (mv_resize);
|
2001-03-29 21:17:45 +00:00
|
|
|
break;
|
2011-12-10 02:21:09 +00:00
|
|
|
|
2012-01-09 11:27:28 +00:00
|
|
|
#if defined (HAVE_XGENERICEVENTS) && defined (XINPUT_2)
|
2011-12-10 02:21:09 +00:00
|
|
|
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, xev->root_y);
|
|
|
|
state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
|
|
|
|
if ((state & button_mask) == 0)
|
|
|
|
finish_drag (mv_resize);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XI_ButtonRelease:
|
|
|
|
update_pos (mv_resize, xev->root_x, xev->root_y);
|
|
|
|
if (xev->detail == mv_resize->moveresize_button)
|
|
|
|
finish_drag (mv_resize);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
2002-04-25 22:29:14 +00:00
|
|
|
return TRUE;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2010-12-15 22:55:04 +00:00
|
|
|
gboolean
|
|
|
|
_gdk_x11_moveresize_configure_done (GdkDisplay *display,
|
|
|
|
GdkWindow *window)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
XEvent *tmp_event;
|
2002-06-18 15:45:05 +00:00
|
|
|
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
|
2010-12-15 22:55:04 +00:00
|
|
|
|
2002-06-18 15:45:05 +00:00
|
|
|
if (!mv_resize || window != mv_resize->moveresize_window)
|
2002-04-25 22:29:14 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (mv_resize->moveresize_pending_event)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
2002-04-25 22:29:14 +00:00
|
|
|
tmp_event = mv_resize->moveresize_pending_event;
|
|
|
|
mv_resize->moveresize_pending_event = NULL;
|
2010-12-15 22:55:04 +00:00
|
|
|
_gdk_x11_moveresize_handle_event (tmp_event);
|
2001-03-29 21:17:45 +00:00
|
|
|
g_free (tmp_event);
|
|
|
|
}
|
2010-12-15 22:55:04 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
return TRUE;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-04-25 22:29:14 +00:00
|
|
|
create_moveresize_window (MoveResizeData *mv_resize,
|
2010-12-15 22:55:04 +00:00
|
|
|
guint32 timestamp)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
|
|
|
GdkWindowAttr attributes;
|
|
|
|
gint attributes_mask;
|
|
|
|
GdkGrabStatus status;
|
|
|
|
|
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;
|
|
|
|
|
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
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
gdk_window_show (mv_resize->moveresize_emulation_window);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2011-11-05 05:10:16 +00:00
|
|
|
status = gdk_device_grab (mv_resize->device,
|
2011-10-28 15:04:11 +00:00
|
|
|
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.
|
|
|
|
*/
|
2006-01-11 14:54:05 +00:00
|
|
|
finish_drag (mv_resize);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
mv_resize->moveresize_process_time = 0;
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2002-12-03 21:57:13 +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,
|
2010-12-05 13:36:59 +00:00
|
|
|
NULL, NULL, &width, &height);
|
2002-12-03 21:57:13 +00:00
|
|
|
|
|
|
|
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,
|
2011-11-05 05:10:16 +00:00
|
|
|
GdkDevice *device,
|
2001-03-29 21:17:45 +00:00
|
|
|
gint button,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
2002-06-18 15:45:05 +00:00
|
|
|
MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
mv_resize->is_resize = TRUE;
|
|
|
|
mv_resize->moveresize_button = button;
|
|
|
|
mv_resize->resize_edge = edge;
|
2011-11-05 05:10:16 +00:00
|
|
|
mv_resize->device = device;
|
2002-04-25 22:29:14 +00:00
|
|
|
mv_resize->moveresize_x = root_x;
|
|
|
|
mv_resize->moveresize_y = root_y;
|
2002-09-25 07:23:55 +00:00
|
|
|
mv_resize->moveresize_window = g_object_ref (window);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-09-20 10:52:26 +00:00
|
|
|
mv_resize->moveresize_orig_width = gdk_window_get_width (window);
|
|
|
|
mv_resize->moveresize_orig_height = gdk_window_get_height (window);
|
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,
|
2002-04-25 22:29:14 +00:00
|
|
|
&mv_resize->moveresize_geometry,
|
|
|
|
&mv_resize->moveresize_geom_mask);
|
|
|
|
|
2002-12-03 21:57:13 +00:00
|
|
|
calculate_unmoving_origin (mv_resize);
|
|
|
|
|
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,
|
2011-11-05 05:10:16 +00:00
|
|
|
GdkDevice *device,
|
2001-03-29 21:17:45 +00:00
|
|
|
gint button,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
2002-06-18 15:45:05 +00:00
|
|
|
MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
mv_resize->is_resize = FALSE;
|
2011-11-05 05:10:16 +00:00
|
|
|
mv_resize->device = device;
|
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;
|
|
|
|
|
2002-09-25 07:23:55 +00:00
|
|
|
mv_resize->moveresize_window = g_object_ref (window);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-12-03 21:57:13 +00:00
|
|
|
calculate_unmoving_origin (mv_resize);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
create_moveresize_window (mv_resize, timestamp);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_begin_resize_drag (GdkWindow *window,
|
2011-11-05 05:10:16 +00:00
|
|
|
GdkWindowEdge edge,
|
|
|
|
GdkDevice *device,
|
|
|
|
gint button,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
guint32 timestamp)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
2009-08-07 16:00:10 +00:00
|
|
|
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
2001-03-29 21:17:45 +00:00
|
|
|
return;
|
|
|
|
|
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_WM_MOVERESIZE")))
|
2011-11-05 05:10:16 +00:00
|
|
|
wmspec_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
|
2001-03-29 21:17:45 +00:00
|
|
|
else
|
2011-11-05 05:10:16 +00:00
|
|
|
emulate_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_begin_move_drag (GdkWindow *window,
|
2011-11-05 05:10:16 +00:00
|
|
|
GdkDevice *device,
|
2010-12-05 20:58:23 +00:00
|
|
|
gint button,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
guint32 timestamp)
|
2001-03-29 21:17:45 +00:00
|
|
|
{
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
|
|
|
!WINDOW_IS_TOPLEVEL (window))
|
2001-03-29 21:17:45 +00:00
|
|
|
return;
|
|
|
|
|
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_WM_MOVERESIZE")))
|
2011-12-28 16:16:54 +00:00
|
|
|
wmspec_moveresize (window, _NET_WM_MOVERESIZE_MOVE,
|
|
|
|
device, button, root_x, root_y, timestamp);
|
2001-03-29 21:17:45 +00:00
|
|
|
else
|
2011-11-05 05:10:16 +00:00
|
|
|
emulate_move_drag (window, device, button, root_x, root_y, timestamp);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
2004-07-11 13:26:57 +00:00
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_enable_synchronized_configure (GdkWindow *window)
|
2004-07-11 13:26:57 +00:00
|
|
|
{
|
2004-08-02 20:01:27 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
if (!GDK_IS_WINDOW_IMPL_X11 (window->impl))
|
2008-07-18 13:03:42 +00:00
|
|
|
return;
|
2008-12-04 09:04:05 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2004-07-11 13:26:57 +00:00
|
|
|
|
2004-08-02 20:01:27 +00:00
|
|
|
if (!impl->use_synchronized_configure)
|
|
|
|
{
|
2008-12-04 09:04:05 +00:00
|
|
|
/* This basically means you want to do fancy X specific stuff, so
|
|
|
|
ensure we have a native window */
|
2009-06-01 12:07:36 +00:00
|
|
|
gdk_window_ensure_native (window);
|
2009-06-01 09:57:59 +00:00
|
|
|
|
2004-08-02 20:01:27 +00:00
|
|
|
impl->use_synchronized_configure = TRUE;
|
|
|
|
ensure_sync_counter (window);
|
2004-07-11 13:26:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_configure_finished (GdkWindow *window)
|
2004-07-11 13:26:57 +00:00
|
|
|
{
|
2004-08-05 17:58:20 +00:00
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (!WINDOW_IS_TOPLEVEL (window))
|
|
|
|
return;
|
2004-08-02 20:01:27 +00:00
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2004-08-05 17:58:20 +00:00
|
|
|
if (!impl->use_synchronized_configure)
|
|
|
|
return;
|
|
|
|
|
2004-07-11 13:26:57 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
|
|
|
{
|
|
|
|
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
|
|
|
|
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
|
|
|
|
|
2004-08-05 17:58:20 +00:00
|
|
|
if (toplevel && toplevel->update_counter != None &&
|
2010-12-20 18:20:10 +00:00
|
|
|
GDK_X11_DISPLAY (display)->use_sync &&
|
2012-09-18 13:31:17 +00:00
|
|
|
toplevel->configure_counter_value != 0)
|
2004-07-11 13:26:57 +00:00
|
|
|
{
|
2012-12-19 17:01:52 +00:00
|
|
|
if (toplevel->configure_counter_value_is_extended)
|
|
|
|
{
|
|
|
|
toplevel->current_counter_value = toplevel->configure_counter_value;
|
|
|
|
if ((toplevel->current_counter_value % 2) == 1)
|
|
|
|
toplevel->current_counter_value += 1;
|
2012-09-18 13:31:17 +00:00
|
|
|
|
2012-12-19 17:01:52 +00:00
|
|
|
toplevel->configure_counter_value = 0;
|
2012-09-18 13:31:17 +00:00
|
|
|
|
2012-12-19 17:01:52 +00:00
|
|
|
set_sync_counter (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
toplevel->extended_update_counter,
|
|
|
|
toplevel->current_counter_value);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
set_sync_counter (GDK_WINDOW_XDISPLAY (window),
|
|
|
|
toplevel->update_counter,
|
|
|
|
toplevel->configure_counter_value);
|
|
|
|
}
|
|
|
|
}
|
2004-07-11 13:26:57 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
2005-03-16 03:17:27 +00:00
|
|
|
|
2010-11-25 11:28:08 +00:00
|
|
|
static gboolean
|
|
|
|
gdk_x11_window_beep (GdkWindow *window)
|
2006-08-30 03:30:43 +00:00
|
|
|
{
|
2006-08-30 16:02:41 +00:00
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
|
|
display = GDK_WINDOW_DISPLAY (window);
|
|
|
|
|
2006-08-30 03:30:43 +00:00
|
|
|
#ifdef HAVE_XKB
|
2010-12-20 18:20:10 +00:00
|
|
|
if (GDK_X11_DISPLAY (display)->use_xkb)
|
2010-11-25 11:28:08 +00:00
|
|
|
{
|
|
|
|
XkbBell (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
GDK_WINDOW_XID (window),
|
|
|
|
0,
|
|
|
|
None);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2006-08-30 03:30:43 +00:00
|
|
|
#endif
|
2010-11-25 11:28:08 +00:00
|
|
|
|
|
|
|
return FALSE;
|
2006-08-30 03:30:43 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_opacity (GdkWindow *window,
|
|
|
|
gdouble opacity)
|
2007-04-30 07:27:22 +00:00
|
|
|
{
|
|
|
|
GdkDisplay *display;
|
|
|
|
guint32 cardinal;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) ||
|
|
|
|
!WINDOW_IS_TOPLEVEL (window))
|
2007-04-30 07:27:22 +00:00
|
|
|
return;
|
|
|
|
|
2010-08-29 00:08:47 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2007-04-30 07:27:22 +00:00
|
|
|
|
|
|
|
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,
|
2007-06-06 00:03:25 +00:00
|
|
|
(guchar *) &cardinal, 1);
|
2007-04-30 07:27:22 +00:00
|
|
|
}
|
|
|
|
|
2010-12-10 17:54:43 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_set_composited (GdkWindow *window,
|
|
|
|
gboolean composited)
|
2007-06-01 12:16:12 +00:00
|
|
|
{
|
|
|
|
#if defined(HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && defined (HAVE_XFIXES)
|
|
|
|
GdkWindowImplX11 *impl;
|
|
|
|
GdkDisplay *display;
|
|
|
|
Display *dpy;
|
|
|
|
Window xid;
|
|
|
|
|
2010-11-22 23:55:39 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
2007-06-01 12:16:12 +00:00
|
|
|
|
2010-10-06 00:00:16 +00:00
|
|
|
display = gdk_window_get_display (window);
|
2007-06-01 12:16:12 +00:00
|
|
|
dpy = GDK_DISPLAY_XDISPLAY (display);
|
2010-11-22 23:55:39 +00:00
|
|
|
xid = GDK_WINDOW_XID (window);
|
2007-06-01 12:16:12 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2010-12-13 18:30:05 +00:00
|
|
|
static void
|
|
|
|
gdk_x11_window_process_updates_recurse (GdkWindow *window,
|
|
|
|
cairo_region_t *region)
|
2009-01-26 18:12:54 +00:00
|
|
|
{
|
2009-01-27 13:10:00 +00:00
|
|
|
_gdk_window_process_updates_recurse (window, region);
|
2009-01-26 18:12:54 +00:00
|
|
|
}
|
|
|
|
|
2009-01-26 18:29:26 +00:00
|
|
|
void
|
2010-12-13 18:30:05 +00:00
|
|
|
_gdk_x11_display_before_process_all_updates (GdkDisplay *display)
|
2009-01-26 18:29:26 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-12-13 18:30:05 +00:00
|
|
|
_gdk_x11_display_after_process_all_updates (GdkDisplay *display)
|
2009-01-26 18:29:26 +00:00
|
|
|
{
|
2012-10-01 08:02:01 +00:00
|
|
|
/* 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);
|
2009-01-26 18:29:26 +00:00
|
|
|
}
|
|
|
|
|
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:
|
2011-07-28 11:27:23 +00:00
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* Return value: the time stamp.
|
|
|
|
**/
|
|
|
|
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);
|
2010-11-22 16:06:46 +00:00
|
|
|
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;
|
|
|
|
}
|
2010-10-05 22:08:25 +00:00
|
|
|
|
|
|
|
/**
|
2011-07-28 11:17:35 +00:00
|
|
|
* gdk_x11_window_get_xid:
|
2011-07-28 11:27:23 +00:00
|
|
|
* @window: (type GdkX11Window): a native #GdkWindow.
|
2010-10-05 22:08:25 +00:00
|
|
|
*
|
|
|
|
* Returns the X resource (window) belonging to a #GdkWindow.
|
|
|
|
*
|
|
|
|
* Return value: the ID of @drawable's 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;
|
|
|
|
}
|
|
|
|
|
2010-11-24 13:36:45 +00:00
|
|
|
return GDK_WINDOW_IMPL_X11 (window->impl)->xid;
|
2010-10-05 22:08:25 +00:00
|
|
|
}
|
|
|
|
|
2010-11-22 19:42:00 +00:00
|
|
|
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;
|
|
|
|
|
2010-11-23 00:46:03 +00:00
|
|
|
impl_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
|
2010-11-22 19:42:00 +00:00
|
|
|
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->translate = _gdk_x11_window_translate;
|
2010-12-10 19:06:13 +00:00
|
|
|
impl_class->destroy = gdk_x11_window_destroy;
|
|
|
|
impl_class->destroy_foreign = gdk_x11_window_destroy_foreign;
|
2010-11-22 19:42:00 +00:00
|
|
|
impl_class->resize_cairo_surface = gdk_window_x11_resize_cairo_surface;
|
2010-11-25 11:17:11 +00:00
|
|
|
impl_class->get_shape = gdk_x11_window_get_shape;
|
|
|
|
impl_class->get_input_shape = gdk_x11_window_get_input_shape;
|
2010-11-25 11:28:08 +00:00
|
|
|
impl_class->beep = gdk_x11_window_beep;
|
2010-12-05 20:58:23 +00:00
|
|
|
|
|
|
|
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_root_origin = gdk_x11_window_get_root_origin;
|
|
|
|
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;
|
2013-01-21 10:52:32 +00:00
|
|
|
impl_class->apply_fullscreen_mode = gdk_x11_window_apply_fullscreen_mode;
|
2010-12-05 20:58:23 +00:00
|
|
|
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->enable_synchronized_configure = gdk_x11_window_enable_synchronized_configure;
|
|
|
|
impl_class->configure_finished = gdk_x11_window_configure_finished;
|
|
|
|
impl_class->set_opacity = gdk_x11_window_set_opacity;
|
2010-12-10 17:54:43 +00:00
|
|
|
impl_class->set_composited = gdk_x11_window_set_composited;
|
2010-12-05 20:58:23 +00:00
|
|
|
impl_class->destroy_notify = gdk_x11_window_destroy_notify;
|
2011-02-01 17:11:35 +00:00
|
|
|
impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol;
|
2010-12-05 20:58:23 +00:00
|
|
|
impl_class->register_dnd = _gdk_x11_window_register_dnd;
|
2010-12-10 06:27:10 +00:00
|
|
|
impl_class->drag_begin = _gdk_x11_window_drag_begin;
|
2010-12-13 18:30:05 +00:00
|
|
|
impl_class->process_updates_recurse = gdk_x11_window_process_updates_recurse;
|
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;
|
2010-12-17 00:00:01 +00:00
|
|
|
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;
|
2010-11-22 19:42:00 +00:00
|
|
|
}
|