Commit Graph

688 Commits

Author SHA1 Message Date
Garrett Regier
793d12d70d Fix leaking calls to gdk_device_manager_list_devices()
gdk_device_manager_list_devices() returns a newly allocated list.

https://bugzilla.gnome.org/show_bug.cgi?id=645234
2011-03-21 10:37:10 -04:00
Benjamin Otte
0c37c88147 gdk: Use CAIRO_OPERATOR_SOURCE when painting double-buffered buffer
Otherwise RGBA surfaces will have issues.

This patch only affects non-implicit paints, ie no paints at all in the
real world.
2011-03-11 02:10:47 +01:00
Benjamin Otte
2a2ad8523f gdk: Add GDK_RENDERING environment variable
It's useful for debugging rendering issues, both correctness and
performance wise.

See the added documentation for what it does and how it works.
2011-03-11 02:10:47 +01:00
Tristan Van Berkom
713fd43c8f Fixed gdk_window_beep() to pass the toplevel instance to the toplevel's implementation vfunc.
This incorrect assignment would cause asynchronous aborts from the X server
(they would occur if for instance, an offscreen GtkTreeView calls
gtk_widget_error_bell()).
2011-03-10 14:10:32 +09:00
Alexander Larsson
a3b2840cae Remove support for GDK_NATIVE_WINDOWS
GDK_NATIVE_WINDOWS was a way to keep some old apps running that did weird
things in gtk2. We should not have to carry this forwards in gtk 3.x.

We do however keep a g_warning() call reminding people of this fact to
ease debugging when they try to port their applications.

https://bugzilla.gnome.org/show_bug.cgi?id=644119
2011-03-08 23:13:39 +01:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Matthias Clasen
8291530abf More GDK documentation tweaks 2011-02-09 02:44:19 -05:00
Garrett Regier
adef25626e Fix annotation that broke the docs
It was added in 0e795b67c3
and removed in f6cc08fa57.
2011-02-08 23:06:42 -08:00
Matthias Clasen
f6cc08fa57 Remove annotation that breaks the docs
Before adding annotations, please check that gtk-doc can handle
them. Else they will be stripped out again.
2011-02-08 20:00:27 -05:00
Martin Pitt
0e795b67c3 [GI] Mark mis-detected constructors as such
constructors which take an object of the same class as its first argument are
mis-detected as method call with "self" argument by the GIR scanner. Using the
new (constructor) annotation from bug 561264, mark some of them as proper
constuctors, so that you can call them with NULL as first argument from
bindings; in particular, this fixes gdk_window_new() and the
gtk_radio_button_new_with*() constructors.
2011-02-02 15:11:06 +01:00
Benjamin Otte
44c02fcbb1 API: gdk: Change get_drag_window() API
The previous function gdk_drag_get_protocol_for_display() took native
window handles, so it had to be changed. Because it didn't do what it
was named to do (it didn't return a protocol even though it was named
get_protocol) and because it doesn't operate on the display anymore but
on the actual window, it's now called gdk_window_get_drag_protocol().
2011-02-01 18:51:57 +01:00
Matthias Clasen
454c36523a Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 18:50:09 -05:00
Benjamin Otte
51290e0a57 gdk: When reffing the impl surface, ref it from the impl window
This was causing surfaces to be created with the wrong size and that
caused broken clipping.

https://bugzilla.gnome.org/show_bug.cgi?id=640195
2011-01-23 21:41:01 +01:00
Tomeu Vizoso
e2d42f3c4b [gi] Return value of gdk_window_new should have transfer full 2011-01-21 17:34:18 +01:00
Pavel Holejsovsky
374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
9b88eb356d [GI] Add missing (scope) annotations 2011-01-20 13:57:15 +01:00
Benjamin Otte
2267602295 gdk: Simplify code
Fold the previous vfunc into the only caller.
2011-01-03 17:44:24 +01:00
Benjamin Otte
8d2104fdc9 gdk: Move window_get_device_position function out of the device hooks 2011-01-03 17:44:24 +01:00
Benjamin Otte
9746991548 API: gdk: Make gdk_display_get_window_at_device_position() a device API
It's now called gdk_device_get_window_at_position(). It doesn't make
sense to keep device-specific API part of the display.
2010-12-27 18:46:41 +01:00
Matthias Clasen
8f816d7c3b Fix a few typos 2010-12-25 00:26:22 -05:00
Matthias Clasen
27ce9421d0 Fix up GDK docs 2010-12-25 00:02:39 -05:00
Benjamin Otte
36893a9ef8 gdk: Make GdkWindow abstract
This way backend implementors get an error if they don't set
display_class->window_type to their subclass. And that's exactly what we
want.
2010-12-21 12:07:09 -05:00
Benjamin Otte
dcb03b1085 gdk: Use G_DEFINE_TYPE for GdkWindow 2010-12-21 12:07:08 -05:00
Benjamin Otte
3036922b3d gdk: Create windows via _gdk_display_create_window()
THe use of this function will become visible in the next commits. But
wrapping g_object_new() is a generally a good idea anyway.
2010-12-21 12:07:08 -05:00
Benjamin Otte
a9637f05b6 gdk: Use g_object_(un)ref instead of gdk_cursor_(un)ref 2010-12-21 12:07:05 -05:00
Benjamin Otte
0b4913a166 gdk: Make GdkCursor a GObject
Also port the X11 implementation. Win32 and Quartz need to be ported
still.
2010-12-21 12:07:04 -05:00
Matthias Clasen
519f09f7f4 Add vfuncs for keyval and window property functions
The keyval functions should really be generic, and the window
property api should be completely revisited, but for now this
will allow us to proceed.
2010-12-21 12:07:03 -05:00
Matthias Clasen
afa0ebf36b Add vfuncs for gdk_test apis 2010-12-21 12:07:02 -05:00
Matthias Clasen
214342eac5 Clean up gdkx.h a bit
Moving the direct-access redefinitions of various macros
to gdkprivate-x11.h and use that header throughout in x11/.

Also remove a workaround for a long-fixed X server bug.
2010-12-21 12:07:01 -05:00
Matthias Clasen
126212b470 Add a vfunc for _gdk_window_impl_new 2010-12-21 12:07:01 -05:00
Matthias Clasen
2d7583c0e3 Make gdk_window_{lookup,foreign_new}_for_display backend specific
At the same time, make GDK_IS_DISPLAY_X11 available in gdkx.h, and
add some exemplaric ifdefs to GTK+ code.
2010-12-21 12:06:59 -05:00
Matthias Clasen
9adb974155 Add a vfunc for _gdk_windowing_window_get_next_serial 2010-12-21 12:06:58 -05:00
Matthias Clasen
ccb6edeb8b Add vfuncs for process_updates_recurse and the before and after hooks 2010-12-21 12:06:58 -05:00
Matthias Clasen
ea96e5e16f Explode gdkinternals.h into per-class private headers
At the same time, move some more class and instance structs
out of public headers.
2010-12-21 12:06:58 -05:00
Matthias Clasen
9a1cc81acb Add a vfunc to replace _gdk_windowing_window_destroy_foreign
All backends updated.
2010-12-21 12:06:57 -05:00
Matthias Clasen
1e694b4dd8 Add a vfunc for gdk_window_set_composited 2010-12-21 12:06:57 -05:00
Matthias Clasen
7f6ac56e3c Add a vfunc for gdk_window_set_composited 2010-12-21 12:06:57 -05:00
Matthias Clasen
a169f6e32d Make GdkDevice parallel-implementable
Use the grab and ungrab vfuncs from the frontend instead of the
_gdk_windowing wrappers, and move some things around accordingly.
Again, only the X11 backend has been updated, other backends
need to be updated to match.
2010-12-21 12:06:56 -05:00
Matthias Clasen
c53ec081ce Add vtables for DND
This commit hides GdkDragContext and GdkDragContextClass, adds
vfuncs for most drag context functionality, and turns the X11 DND
implementation into GdkDragContextX11. We also add vfuncs to
GdkDisplay for gdk_drag_get_protocol and to GdkWindow for
gdk_drag_begin, and implemenet them for X11.
Other backends need similar treatment and are broken now.
2010-12-21 12:06:56 -05:00
Matthias Clasen
de84a7b14f Move gdk_window_lookup to common code 2010-12-21 12:06:55 -05:00
Alexander Larsson
ac7d55c948 Convert all gdk_window methods to vtable calls 2010-12-21 12:06:54 -05:00
Carlos Garnacho
17e97467df Strengthen checks in functions taking a GdkDevice
Docs have also been improved, to make explicit the device
type/source accepted.
2010-12-20 23:08:10 +01:00
Colin Walters
d08ff485f2 gdkwindow: Fix event unref iteration
We were double looping previously which caused a NULL deref.
2010-12-17 15:41:15 -05:00
Colin Walters
806c04411d gdk: Fix GdkWindowFilter internal refcounting
Running gnome-shell under valgrind, I saw the attached invalid write.
Basically we can destroy a window during event processing, and the old
window_remove_filters simply called g_free() on the filter, ignoring
the refcount.  Then later in event processing we call filter->refcount--,
which is writing to free()d memory.

Fix this by centralizing list mutation and refcount handling inside
a new shared _gdk_window_filter_unref() function, and using that
everywhere.

==13876== Invalid write of size 4
==13876==    at 0x446B181: gdk_event_apply_filters (gdkeventsource.c:86)
==13876==    by 0x446B411: _gdk_events_queue (gdkeventsource.c:188)
==13876==    by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410)
==13876==    by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317)
==13876==    by 0x4AB7159: g_main_context_dispatch (gmain.c:2436)
==13876==    by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087)
==13876==    by 0x4AB806A: g_main_loop_run (gmain.c:3295)
==13876==    by 0x8084D6B: main (main.c:722)
==13876==  Address 0x1658bcac is 12 bytes inside a block of size 16 free'd
==13876==    at 0x4005EAD: free (vg_replace_malloc.c:366)
==13876==    by 0x4ABE515: g_free (gmem.c:263)
==13876==    by 0x444BCC9: window_remove_filters (gdkwindow.c:1873)
==13876==    by 0x4454BA3: _gdk_window_destroy_hierarchy (gdkwindow.c:2043)
==13876==    by 0x447BF6E: gdk_window_destroy_notify (gdkwindow-x11.c:1115)
==13876==    by 0x43588E2: _gtk_socket_windowing_filter_func (gtksocket-x11.c:518)
==13876==    by 0x446B170: gdk_event_apply_filters (gdkeventsource.c:79)
==13876==    by 0x446B411: _gdk_events_queue (gdkeventsource.c:188)
==13876==    by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410)
==13876==    by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317)
==13876==    by 0x4AB7159: g_main_context_dispatch (gmain.c:2436)
==13876==    by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087)

https://bugzilla.gnome.org/show_bug.cgi?id=637464
2010-12-17 12:07:37 -05:00
Carlos Garnacho
2c8c1c6df4 Remove *_set_extension_events() and old API to query devices.
The old functions to get core pointer and devices list are gone as
well. This slice is entirely replaced internally by multidevice
handling and may just go.
2010-12-17 16:25:14 +01:00
Matthias Clasen
208d717fef Optimize gdk_window_set_shape_combine_region
When setting no shape on an unshaped window, nothing changes,
so return early instead of recomputing lots of visibility
information.

Pointed out by Owen Taylor in bug 637156.
2010-12-14 22:21:39 -05:00
Carlos Garnacho
44a7ef7bec Add gdk_window_[gs]et_source_events()
This function will enable events for all devices of a given
GdkInputSource, either these available at the time of the call,
or these that are connected in the future.
2010-12-15 03:17:59 +01:00
Carlos Garnacho
f5a20ab65a Add gdk_event_[gs]et_source_device().
This function may be used to know the hardware device that triggered
an event, it could resort to the master device in the few cases there's
not a direct hardware device to relate to the event (i.e.: crossing events
due to grabs)
2010-12-15 03:17:58 +01:00