Commit Graph

3186 Commits

Author SHA1 Message Date
Matthias Clasen
870fefbfaf Minor doc clarification for gdk_drag_begin
Mention that targets is a list of atoms. Bug 611317.
2010-04-03 20:59:07 -04:00
Matthias Clasen
21b1a03e1e Init gdk in the same order as other backends
Patch by Andre Draszik, bug 609172
2010-04-03 20:56:22 -04:00
Matthias Clasen
d1babc7775 Fix a memory leak in gdk_display_open in the directfb backend
Patch by Andre Draszik, bug 609172
2010-04-03 20:56:22 -04:00
Matthias Clasen
db0faed54c Simplify the DirectFBInit call
Patch by Andre Draszik, bug 609172
2010-04-03 20:56:22 -04:00
Matthias Clasen
f6a173d302 Catch directfb errors in gdk_colormap_new
Patch by Andre Draszik, bug 609172.
2010-04-03 20:56:22 -04:00
Matthias Clasen
938795f922 Fix a crash at startup in the directfb backend
Patch by André Draszik, bug 600789
2010-04-03 20:56:22 -04:00
Matthias Clasen
9160cf1af7 Fix gdk_windowing_window_at_pointer in the directfb backend
Patch by Hiroyuki Ikezoe, see bug 604799.
2010-04-03 20:56:21 -04:00
Matthias Clasen
c5dc38c142 Protect against X errors when clearing the DND cache
This was reported as a problem in bug 609952.
2010-04-03 20:56:21 -04:00
Matthias Clasen
2f772399ce Only look at x11 backend for gtk-doc comments for now
See followup discussion in bug 610701
2010-04-03 20:56:20 -04:00
Matthias Clasen
9414dc2cf6 Add some missing introspection annotations 2010-04-03 20:56:19 -04:00
Johan Dahlin
087ff5f220 [build] Include all target source files
Include all target source files when buildin the gir

https://bugzilla.gnome.org/show_bug.cgi?id=610701
2010-04-03 20:56:19 -04:00
Matthias Clasen
12b8b8bf7c Add a missing introspection annotation for gdk_screen_get_default_colormap 2010-04-03 20:56:19 -04:00
Johan Dahlin
eee7bb2b2e [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-04-03 20:56:15 -04:00
Javier Jardón
2140a5b107 [gdk/x11] Change the name of the functions in the header file
_gdk_keymap_add_virtual_modifiers() changed to
_gdk_keymap_add_virtual_modifiers_compat() in
commit 13d69e552d
This patch change the header name too.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=610063
2010-04-03 20:56:14 -04:00
Matthias Clasen
29efd9a753 Fix a compatibility problem
It turns out that my attempt at handling Super, Hyper and Meta better
is causing problems, mostly because Alt and Meta are commonly colocated
in the modmap, and apps do a check for the Alt modifier regularly.

See e.g bug 607697.
2010-04-03 20:56:13 -04:00
Alejandro Piñeiro
b6139abb37 Solve a wrong reference on gdk_keymap_translate_keyboard_state
Solves https://bugzilla.gnome.org/show_bug.cgi?id=608345
2010-04-03 20:56:08 -04:00
André Draszik
935a3f7b65 gdk/directfb: cursor size is artificially limited
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>
2010-04-03 20:56:07 -04:00
André Draszik
987256968b gdk/directfb: convert gdkgc-directfb to using G_DEFINE_TYPE
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609199

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:07 -04:00
André Draszik
9bc658f6ed gdk/directfb: gdkdnd-directfb's private data is used uninitialized
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>
2010-04-03 20:56:07 -04:00
André Draszik
2e9a0028fb gdk/directfb: convert gdkcolor-directfb to using G_DEFINE_TYPE
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609191

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:07 -04:00
André Draszik
442f7a9d26 gdk/directfb: fix _gdk_windowing_pointer_grab()
Fix for bgo #609188

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:06 -04:00
Matthias Clasen
fe7af7a9e5 Make DND work better with shaped windows
If mouse clicks go through, drag-and-drop should too...
Fixes bug 608615.
2010-04-03 20:56:05 -04:00
Kristian Rietveld
a86bbf759f Improve enter/motion notify semantics
On X11 we receive enter notify and motion notify events for a window
regardless of its focus state.  On Mac OS X this is not the case.  This
commit improves the semantics to overcome this difference.  It improves
on my earlier patch that sent a motion notify event when a window became
main.

Instead of sending a motion notify when a window becomes main, we now
send one when a window becomes key, which comes closest to a window
getting focus in X11.  This motion notify is needed because Mac OS X does
not send motion events when an application is inactive (none of its
windows have focus), these events are sent in X11.  This dummy motion
notify event (with current coordinates of the mouse cursor) allows an
application to get its prelight and other state right when it gets focus
and thus user attention.

Another change is to send an enter notify event when updating the
tracking rectangle of a GdkQuartView and the mouse cursor is currently in
this rectangle.  This rectangle is at least updated on window creation.
This enter notify event is important for the case where a new window
appears right below the mouse cursor.  The window has to receive an enter
notify event for the subsequent events to be processed correctly.  Mac
OS X does not send one in this case, so we generate it ourselves.

Both of these synthesized events have to go through
_gdk_windowing_got_event() for updating statekeeping, etc.
append_event() has a boolean flag now to make this convenient.
2010-04-03 20:55:29 -04:00
Matthias Clasen
a7e91ca4ca Minor doc fix 2010-04-03 20:55:24 -04:00
Alexander Larsson
b8a0ff9e04 Avoid integer overflow in gdk_rectangle_intersect
If e.g. the right edge of the leftmost rectangle is near MIN_INT, and
the left edge of the rightmost rectangle is large then subtracting these
can lead to an integer overflow, making the resultant "width" falsely
positive, thus returning a very wide result instead of the expected
no-intersection result.

We avoid the overflow by not doing the subtraction unless we know the
result will be positive. There are still risks for overflow if x + width
or y + width is larger than MAXINT, but we won't ever overflow for valid
rects now.

This may fix #607687
2010-04-03 20:55:23 -04:00
Alexander Larsson
b26536162c When native window requests button presses request other button related events
We need to do this because otherwise the implicit button grab for this
(native) window will not deliver the button events not selected for
by this window. This is a problem because non-native child windows may
select using a wider event mask, and we can't emulate these events if we
don't get the native events.

Fixes bug #607508
2010-04-03 20:55:22 -04:00
Alexander Larsson
8f125f9b93 Drop outstanding cairo surfaces when window is made native
Any old cairo_surface referencing the old impl window will be wrong
when we make a window native, so drop it.

This fixes bug #599511
2010-04-03 20:55:22 -04:00
Alexander Larsson
26d5674b65 Move common gdkwindow.c code into function gdk_window_drop_cairo_surface
This code is duplicated in several places, and more to come, so put
it all in one place.
2010-04-03 20:55:22 -04:00
Alexander Larsson
e9da5b95de Track direct window cairo access and avoid tricks when used
When a cairo surface is requested for direct window access (i.e. not
when double-buffering) we can't really track when the actual drawing happens
as cairo drawing is not virtualized. This means we can't properly flush
any outstanding window moves or implicit paints.

This actually causes problems with e.g. abiword (bug #606009) where they
draw without double-buffering. If you press down it scrolls the window
and then draws the caret, but the caret drawing does not flush the
outstanding move from the scroll, so the caret gets drawn on the wrong
screen.

We fix this by never allowing either implicit paints or outstanding window
moves on impl-windows where any windows related to it has an outstanding
direct cairo surface. Luckily this is not very common so in practice this
doesn't matter much.
2010-04-03 20:55:21 -04:00
Alexander Larsson
51b774f59a Avoid drawing implicit paints to destroyed windows
It may happen that a window gets destroyed during painting, if so
we should not draw the implicit paint double-buffered pixmap to it
as that will cause a BadDrawable X error.

This fixes bug 600865
2010-04-03 20:55:19 -04:00
Matthias Clasen
6860f86724 Plug a pixmap leak
We were getting our refcounts tangled up when setting drawable clips on
GCs with CSW, leading to a pretty bad pixmap leak. See bug 606143.
2010-04-03 20:55:13 -04:00
Javier Jardón
a821df1577 [docs] Add missing "Deprecated: 2.x" to the api doc comments 2010-04-03 20:55:13 -04:00
Javier Jardón
54573f1582 [docs] Add documentation for GdkWindow 'cursor' property
Reported by Rafal Luzynski here:
https://bugzilla.gnome.org/show_bug.cgi?id=604821
2010-04-03 20:53:49 -04:00
Hiroyuki Ikezoe
699fc85a67 Use CAIRO_VERSION instead of CAIRO_VERSION_CODE
Cairo does not have CAIRO_VERSION_CODE macro.
Fix for bug #605472.
2010-04-03 20:53:49 -04:00
Johan Dahlin
3871291ba3 Make sure Gdk-2.0.gir is installed
Fixes a variable name typo
2010-04-03 20:53:47 -04:00
Johan Dahlin
9242d1414d Avoid warnings when introspetion is not available
-include is the same as include but will never warn if the
file is not available
2010-04-03 20:53:47 -04:00
Johan Dahlin
e4ac9609a2 Fix build with system install of introspection
Or redo it properly and remove previous hack by Matthias.
2010-04-03 20:53:47 -04:00
Kristian Rietveld
b8fa675a6a Release view after setting it as contentView
Fixes GdkQuartzView being leaked.
2010-04-03 20:53:47 -04:00
Kristian Rietveld
969ff4c863 Fix memleak in get_nsscreen_for_point()
One codepath did not go through GDK_QUARTZ_RELEASE_POOL, refactored
the code to fix this.
2010-04-03 20:53:47 -04:00
Kristian Rietveld
81cf73ae8a Fix memory leak in GdkQuartzView
Should remove the tracking rect in dealloc.
2010-04-03 20:53:46 -04:00
Kristian Rietveld
8273349eca Use CGFLOAT_DEFINED, don't rely on NSINTEGER_DEFINED for this 2010-04-03 20:53:46 -04:00
Kristian Rietveld
0d51400b29 Add gdk_keymap_map_virtual_modifiers() to Quartz backend 2010-04-03 20:53:46 -04:00
Kristian Rietveld
f7daeec10f Start using CGFloat
Fixes a bunch of compiler warnings.  Since CGFloat does not exist on
Tiger and earlier, we have added a typedef likewise as was done for
NSInteger.
2010-04-03 20:53:46 -04:00
Kristian Rietveld
5d3e414994 Fix compile warning in gdk_cursor_new_from_pixmap 2010-04-03 20:53:46 -04:00
Kristian Rietveld
b86b00b387 initWithContentRect: has a NSUInteger parameter now
The typedef in place for Tiger and earlier systems should change this
to unsigned int without problems.
2010-04-03 20:53:46 -04:00
Kristian Rietveld
e9b593c2e6 Start using NSInteger and NSUInteger
These have been introduced in Leopard and default to int and unsigned int.
In 64-bit Snow Leopard they are long and unsigned long.  This caused issues
with the getRectsBeingDrawn message which needs a pointer to a NSInteger
(long on 64-bit!) but we passed in an integer.  Surprisingly this problem
was visible when compiling with -O0 (segfault), but *not* when compiling
with -O1.  Other messages were NSInteger is now needed have also been
adapted.

Since NSInteger and NSUInteger are not available on Tiger, a define
has been added to add typedefs for these when they have not been defined
by the system headers.
2010-04-03 20:53:44 -04:00
Tor Lillqvist
a75065a458 Add gdk_keymap_map_virtual_modifiers() implementation 2010-04-03 20:53:38 -04:00
Matthias Clasen
afbc052916 Fix a think in the CSW input extension handling
This was causing stack overflow due to an obvious infinite recursion.
See e.g. RH #548849.
2010-04-03 20:53:38 -04:00
Matthias Clasen
d1c3745b07 Try harder to handle accelerators involving virtual modifiers
This patch changes GDK to add all matching virtual modifiers in
the state field of the key event. The corresponding GTK+ change makes
use of a new GdkKeymap function to map virtual modifiers back to
real modifiers and detect conflicts while doing so.

This should fix bug 603190 and bug 427409.
2010-04-03 20:53:37 -04:00
Matthias Clasen
4bc8dcede8 Properly free damage events
This was reported in bug 605008
2010-04-03 20:51:57 -04:00