Commit Graph

3173 Commits

Author SHA1 Message Date
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
Matthias Clasen
360820e9bf Fix a thinko in computing damage for segments
The code was not taking the endpoint of the first segment into account.
This was reported in bug 604747.
2010-04-03 20:51:56 -04:00
Matthias Clasen
214d5efdd4 Ensure native windows in gdk_property_change
Using X properties on non-toplevel windows is somewhat exotic,
but some people seem to do it, so better to keep it working.
See bug 604787.
2010-04-03 20:51:55 -04:00
Alexander Larsson
89ac81e767 Actually send exposes from gdk_window_clear_area_e 2010-04-03 20:51:55 -04:00
Javier Jardón
0c991c5645 Add 'Since: 2.18' tag
Add missing 'Since:' tag in gdk_window_get_root_coords() and
gdk_window_is_destroyed()

Reported by Rafal Luzynski in
https://bugzilla.gnome.org/show_bug.cgi?id=604821
2010-04-03 20:51:55 -04:00
Tor Lillqvist
9d4e82a0dc Make the OLE2 DND code selectable at run-time instead of compile-time
(It still doesn't work, though.)
2010-04-03 20:51:54 -04:00
Johan Dahlin
3a4f027074 Use Makefile.introspection
Use the new fancy rules from the Makefile.introspection, it makes
the rules prettier and avoids quite a bit of duplication
2010-04-03 20:51:54 -04:00
Johan Dahlin
6c9bfc5f39 Make sure dist check works with introspection
We need to prepend the srcdir to all variables
passed into the scanner as it runs with srcdir != builddir during
distcheck.
2010-04-03 20:51:53 -04:00
Johan Dahlin
9d4674a5ec Re-add accidentially removed gtkintl header 2010-04-03 20:51:53 -04:00
Johan Dahlin
7c0624aa92 Separate private from public gdk headers
We don't want to parse the private gdk headers when
creating the GIR.
2010-04-03 20:51:52 -04:00
Colin Walters
f584679cfa Merge in Gdk-custom.c introspection annotations
The Gdk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GDK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.

https://bugzilla.gnome.org/show_bug.cgi?id=592279
2010-04-03 20:51:51 -04:00
Colin Walters
41342b23e5 Build introspection data for gdk-pixbuf, gdk, and gtk
Generate .gir and .typelib files for gdk-pixbuf, gdk, and gtk.

https://bugzilla.gnome.org/show_bug.cgi?id=592279
2010-04-03 20:51:51 -04:00
Tor Lillqvist
3546feb389 Add copyright note and comment for merged old code 2010-04-03 20:51:51 -04:00
Tor Lillqvist
af37f76bc6 Work on OLE2-based generic DND
Intermediate commit of work in progress on integrating the old code
for OLE2-based generic drag and drop from Arhaeopteryx Software, from
a long time ago in the GTK+ 1.3 timeframe. Does still not work and is
as before not compiled in unless OLE2_DND is defined in
gdkdnd-win32.c. (Thus, for inter-process DND, still only WM_DROPFILES
style dropping of files on GTK+ apps works.)

Related slight refactoring of other code that shouldn't change how it
works. Add more global variables for run-time constants (once
initialized) representing well-known GdkAtoms and registered Windows
clipboard formats, as they with the generic DND code will be needed in
several source files. Some improved debugging output.
2010-04-03 20:51:51 -04:00