When GDK looks for the window under pointer, the gdk-directfb backend
looks at windows starting from the root window to the upper window in
the stack. For this, it looks at window's size and position. This
patch fix the assumption that windows are always natives windows from
which we can retrieve backend's private data.
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
Since GDK has introduced the offscreen window concept, pixmap can be
created using drawables which aren't native windows. This patch fix
this assumption.
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
The window management code used to deal with gdk internals. It seems a
lot of code has been pushed to the generic gdk code, so we remove
useless code.
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
Make it look more like the x11 backend. Also some people reported
crash early in the backend initialization about some colormap stuff,
this should avoid the problem.
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
The event translation code used to deal a lot with gdk internals. It
seems a lot of code has been pushed to the generic gdk code, so we
needed to rewrite the things a little bit.
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
The computation of abs_x,abs_y is done by the generic code of GDK when
events are raised. We don't care about that anymore.
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.
https://bugzilla.gnome.org/show_bug.cgi?id=613284
Cursor sizes in DirectFB can be large (4095x4095), limit to 128x128
though, because the x11 backend has this limit, too - for max.
compatibility.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609201
Signed-off-by: Javier Jardón <jjardon@gnome.org>
Use G_TYPE_INSTANCE_GET_PRIVATE() instead
In the process, convert to using G_DEFINE_TYPE, too.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609195
Signed-off-by: Javier Jardón <jjardon@gnome.org>
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.
https://bugzilla.gnome.org/show_bug.cgi?id=600158
This has two advantages:
1) In many backends, this is faster as we can terminate the window
hierarchy traversal earlier
2) When used in gdkdisplay.c::get_current_toplevel() to get the
current toplevel that has the pointer we now correctly return
a toplevel with the pointer in it where the pointer is inside
some foreign subwindow of a toplevel window.
The second advantage fixes some bugs in client side event generation
when the pointer is inside such a foreign child window.
The X11 queue_translation operation uses NextRequest to get the serial
of the XCopyArea operation where the translation should end. However,
if the gc passed to gdk_draw_drawable has a non-flushed clip region
(which it commonly has now for the window clipping) then the next
operation will be the GC flush, not the XCopyArea.
To handle this right we now pass in the GC to be used to
queue_translation and ensure that it is flushed before calling
NextRequest().