Commit Graph

3186 Commits

Author SHA1 Message Date
Matthias Clasen
aadb190b77 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.
2009-12-18 19:17:04 -05:00
Matthias Clasen
7a9a3077e4 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.
2009-12-18 18:43:32 -05:00
Alexander Larsson
7e9d89b555 Actually send exposes from gdk_window_clear_area_e 2009-12-18 15:35:04 +01:00
Javier Jardón
674dd557e8 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
2009-12-18 10:53:01 +01:00
Tor Lillqvist
435606a5bf Make the OLE2 DND code selectable at run-time instead of compile-time
(It still doesn't work, though.)
2009-12-17 01:51:51 +02:00
Johan Dahlin
eadc7885da Use Makefile.introspection
Use the new fancy rules from the Makefile.introspection, it makes
the rules prettier and avoids quite a bit of duplication
2009-12-16 17:22:02 -02:00
Johan Dahlin
248d4b1622 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.
2009-12-16 17:22:02 -02:00
Johan Dahlin
09362d6e34 Re-add accidentially removed gtkintl header 2009-12-16 17:22:02 -02:00
Johan Dahlin
80c7937d60 Separate private from public gdk headers
We don't want to parse the private gdk headers when
creating the GIR.
2009-12-16 17:22:01 -02:00
Colin Walters
18dc96caf8 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
2009-12-16 17:22:01 -02:00
Colin Walters
78758d43ea 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
2009-12-16 17:22:00 -02:00
Tor Lillqvist
6e73be9d6c Add copyright note and comment for merged old code 2009-12-16 13:47:57 +02:00
Tor Lillqvist
eb21a7df29 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.
2009-12-16 13:10:21 +02:00
Tor Lillqvist
c196ac2b63 Make more GdkAtom variables visible in all gdk/win32 files
Make the GdkAtoms for the image formats extern and usable from all
gdk/win32 files.
2009-12-16 13:10:20 +02:00
Tor Lillqvist
c1ddd8f9bc Make the gdk/win32 event debug printing function non-static
Make print_event() extern and rename it to _gdk_win32_print_event() so
it can be used from all gdk/win32 source files.
2009-12-16 13:10:19 +02:00
Tor Lillqvist
1bf9a2fa41 Remove unused functions and variables 2009-12-16 13:10:18 +02:00
Matthias Clasen
182108c68e Implement gdk_screen_get_primary_monitor in all GDK backends
The implementations are all trivial, just returning 0. At least
for Quartz, we could probably do better than that. Bug 604459.
2009-12-13 20:40:02 -05:00
Cody Russell
53ab5c0b63 Add gdk_screen_get_primary_monitor to gdk.symbols 2009-12-09 23:20:30 -06:00
Cody Russell
662e69ad3e Add gdk_screen_get_primary_monitor(). This fixes bug #601712 2009-12-08 11:27:02 -06:00
Matthias Clasen
0748cf563d Never do implicit paints for foreign windows
They don't need double buffer combination since they have no
client-side children, and creating pixmaps for them is risky
since they could disappear at any time.

May fix bug 598476 and 603652.
2009-12-08 10:09:04 -05:00
Matthias Clasen
105b007545 Set colormap of offscreen pixmaps
This fixes problems in clutter-gtk. See bug 603619.
2009-12-08 09:58:23 -05:00
Alexander Larsson
22d1d0d507 Fix up last commit 2009-12-08 12:28:44 +01:00
Alexander Larsson
159214173d Handle input extension events when making a window native
It may happen when turning a client side window into a native window
that the window, or some of its children with the same native parent
have extension events enabled, and thus have an input window enabled
for the native parent which needs to change as the window is made
native.

We fix this by temporarily disabling extension events on all the affected
windows while we create the native window, and then reenable them afterwards.

This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=544624
2009-12-08 12:22:59 +01:00
Alexander Larsson
98a9c5c69a Fix damage report for lines drawn on offscreen windows
All kinds of lines (lines, segments, arcs, etc) need to take into
account the line properties (width, miter limit, joins, caps, etc)
to get proper damage extents.

This is not really possible to do, but we can make it likely to work
with some ad-hoc estimates.

Fixes bug 603904.
2009-12-07 10:49:57 +01:00
Alexander Larsson
48fc0f36c2 Fix mouse pointer handling on multiple screens
The fix in 786b589d95 for the
"Cannot click buttons more than once without moving the mouse cursor"
did not correctly handle setups with multiple screens in one display.

We need to handle the case where the first XQueryPointer returns
a different root window than the default one.

This fixes bug 597386 (agaion)
2009-12-07 10:49:57 +01:00
Alexander Larsson
b509f28559 Don't filter out BUTTON_MOTION event masks
We don't really need to filter these out, it was just a leftover
safety check to not override the GDK_POINTER_MOTION_MASK.

Furthermore when we changed behaviour to not always select for native
pointer motion it is actually wrong. We'll still get normal motion
events for the toplevel which we will emulate as button motion on the
child, but the button motion mask will not be inherited by implicit
grabs which makes us not get any motion events during grabs.

This fixes bug 601473
2009-12-02 11:19:21 +01:00
Javier Jardón
ee2c797e70 [gdk/directfb] Made dfb_events_dispatch() thread save
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=591438
2009-11-30 06:02:49 +01:00
Matthias Clasen
36ca3fd5e9 Add a missing include
memset() is used in gdk/x11/gdkinput-xfree.c but string.h is not included.
Patch by Vincent Untz, bug 597026.
2009-11-27 20:59:42 -05:00
Matthias Clasen
43a07af9b1 Be a bit more forgiving about invalid monitor number
By moving the g_return_if_fail() checks into individual monitor functions.
See bug 561130.
2009-11-27 18:39:15 -05:00
Matthias Clasen
5bfab2b9d4 Short-circuit get_frame_extents for override-redirect windows
There's no reason to do our expensive round-trips for an override-redirect
window; just use local information. See bug 581145. Patch by Owen Taylor.
2009-11-27 18:19:20 -05:00
Matthias Clasen
d4b92737ab Make level3 keys work again
We were not paying attention to consumed modifiers when adding
virtual modifiers. This fixes RH bug 537567.
2009-11-25 01:02:40 -05:00
Kristian Rietveld
cffddd2adc Document how Cocoa coordinate and monitor layout transforms to GDK work 2009-11-15 15:29:45 +01:00
Tor Lillqvist
7fda8e6378 Awful hack for problem in dnd of images from Firefox on Windows
Bypassed with #if 0 because it is an awful hack and not really
acceptable from a privacy point of view for instance. It prevents
Firefox from deleting temporary files containing images being dragged,
so they stay on disk. Bug #561973.
2009-11-15 00:37:17 +02:00
Kjartan Maraas
d03b53800e Fix typo 2009-11-11 21:39:32 +01:00
Javier Jardón
ecc3065f76 Only use gdk_input_select_events() if XINPUT_NONE is defined
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=601337
2009-11-11 17:42:20 +01:00
Javier Jardón
cd2ff792ca [gdk] Added GDK_GPOINTER_TO_NATIVE_WINDOW() macro
GdkNativeWindow cast is needed in 64-bit Windows so gpointer data
is converted to a (64-bit) native window handle.
GPOINTER_TO_UINT() is used in other platforms.
2009-11-10 20:15:37 +01:00
Javier Jardón
7d1c8fa644 [gdk/x11/gdkdnd-x11] Add missing "Deprecated: 2.x" to the api doc comments. 2009-11-06 03:41:02 +01:00
Javier Jardón
0d55c6ede1 [gdk/gdkimage] Add missing "Deprecated: 2.x" to the api doc comments. 2009-11-06 03:37:56 +01:00
Javier Jardón
7bc07ffe86 [gdk/gdkgc] Add missing "Deprecated: 2.x" to the api doc comments. 2009-11-06 03:30:31 +01:00
Javier Jardón
925fa99393 [gdk/gdkdraw] Add missing "Deprecated: 2.x" to the api doc comments. 2009-11-06 03:26:27 +01:00
Javier Jardón
64d054264e [gdk/gdkcolors] Add missing "Deprecated: 2.x" to the api doc comments. 2009-11-06 03:16:34 +01:00
Javier Jardón
8082aad271 Use "Deprecated:" gtk-doc symbol corrently
Also, added some suggestion about replacements for deprecated functions
2009-11-06 03:03:40 +01:00
Nicola Fontana
1e1131c959 Do not use static GTypeInfo and GInterfaceInfo
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
2009-11-06 01:21:09 +01:00
Alexander Larsson
9e51c10edc Don't unnecessarily clear windows with no exposure mask set
When we just invalidate some area from the app we don't need to clear
windows with no exposure mask, because that wouldn't have happened pre-csw
anyway. Additionally we can avoid such clearing for native windows in cases
where the xserver already did the clearing like on exposes or when resizing
toplevels.

This means we don't fully redraw a GtkSocket when it resizes, thus
avoiding flicker in gnome-mplayer as reported in this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=598050
2009-11-05 12:52:12 +01:00
Alexander Larsson
9ae0d9a44f Document clears_as_native and make the name more descriptive 2009-11-05 12:52:12 +01:00
Alexander Larsson
39993f147f Add supports_native_bg to GdkWindowImpl
Backends that support native window background setting (and that clears
new window areas to this color/pixmap) should set this to true.

Currently only X11 supports this.
2009-11-05 12:52:12 +01:00
Alexander Larsson
4cd5c98942 Don't unnecessarily expose areas copied by native windowing system
When moving or scrolling a window with native children, there is no
need to expose the areas that are copied by the windowing system
as part of moving/resizing the native windows anyway.
2009-11-05 12:52:12 +01:00
Alexander Larsson
a299797883 Only send exposes on unmap if window really was unmapped
Exposing when you hide a hidden window is just a waste of time.
2009-11-05 12:52:12 +01:00
Alexander Larsson
8c1ea38d84 Flush outstanding stuff when clearing directly on a window
Clearing will directly modify the contents of the window, so we need
to flush any outstanding moves or double-buffering.
2009-11-05 12:52:11 +01:00
Javier Jardón
3dbfc08a7a Fix some compilation warnings
Fixed the prototypes of MyEnhancedXkbTranslateKeyCode() and
translate_keysym() to take a gint* because those functions treat
these arguments as an int, so we get around the need to cast.
2009-10-30 18:33:16 +01:00
Javier Jardón
d76287c94b Fix warning: cast to gchar* 2009-10-30 04:04:28 +01:00
Javier Jardón
c368c6e425 Use G_STRLOC instead __LINE__ 2009-10-26 18:19:48 +01:00
Javier Jardón
a667ee8e5e Use G_STRFUNC instead __FUNCTION__ 2009-10-26 18:17:23 +01:00
Kristian Rietveld
a338c7e929 Update copyright 2009-10-26 09:57:11 +01:00
Kristian Rietveld
fa8fa48ef1 Update position of toplevels after display reconfiguration
We have to do this, especially after the screen containing the menubar
has changed.  Such more larger changes in monitor geometry will cause
changes to how monitors are laid out in the root window.  The position
coordinates of the windows will have to be updated to reflect their
position in the new layout.
2009-10-26 09:52:54 +01:00
Kristian Rietveld
a4d932cc64 Fixup get_nsscreen_for_x() 2009-10-26 09:52:54 +01:00
Kristian Rietveld
221883dd31 Remove unused variable (fix compiler warning) 2009-10-26 09:52:54 +01:00
Kristian Rietveld
93530675de Update size of root window after display reconfiguration 2009-10-26 09:52:54 +01:00
Kristian Rietveld
959a9437e6 Support arbitrary screen layouts
The Quartz port now supports arbitrary multiple monitor layouts instead
of only monitors are were laid out horizontally.  This builds on the
reworked coordinate translation done in a previous commit.
2009-10-26 09:52:54 +01:00
Kristian Rietveld
8846012c6d Rework coordinate transformation to be based on root window
The root window contains all the monitors attached to a Mac.  The
coordinate transformation now both translates the x and y coordinate,
translating it from the Cocoa monitor coordinate space to the GDK
coordinate space.  How monitors are laid out in the root window differs
between Cocoa and GDK, which is why it is important to translate based
on the root window to get multi monitor setups to work properly.

We have replaced the old y coordinate transformation function with
new functions that translate both the x and y coordinate.

When creating new toplevels, we have to determine the Cocoa screen on
which the toplevel should appear and translate the coordinates according
to that screen.

This change also fixes event handling in case there is a monitor left
of the screen containing the menu bar.  In such a case all coordinates
on the left monitor are negative.  Event handling broke, because of
_gdk_quartz_window_find_child() checking bounds.  Now that coordinates
are always properly translated to GDK coordinate space, in which negative
coordinates do never occur, the checks here will work properly.
2009-10-26 09:52:54 +01:00
Kristian Rietveld
d26dd103b2 Be consistent with X11: emit monitors-changed first, then size-changed 2009-10-26 09:52:53 +01:00
Kristian Rietveld
aa25e4a51c Update documentation for ::monitors-changed to mention OS X support 2009-10-26 09:52:53 +01:00
Kristian Rietveld
e36872da38 Use screen when emitting signal, not _gdk_screen 2009-10-26 09:52:53 +01:00
Kristian Rietveld
63e2f54516 Emit monitors-changed signal when appropriate 2009-10-26 09:52:53 +01:00
Kristian Rietveld
12dc617dc2 Move screen resolution setup to GdkScreenQuartz initializer 2009-10-26 09:52:53 +01:00
Kristian Rietveld
d47772f002 Create a proper subclass of GdkScreen: GdkScreenQuartz 2009-10-26 09:52:52 +01:00
Kristian Rietveld
73b55ae8f5 Register and handle a display reconfiguration callback
Using this we can update our internal monitor/screen layout state
and emit the GdkScreen::size-changed signal.  Work has not
completely finished on this yet, see bug 596238.
2009-10-26 09:52:52 +01:00
Kristian Rietveld
ce3c861c2a Setup monitor rects during screen initialization and re-use data 2009-10-26 09:52:52 +01:00
Kristian Rietveld
ca20b04b58 Move screen initialization to gdkscreen-quartz.c 2009-10-26 09:52:52 +01:00
Michael Emmel
04d7d81056 Fix for position bug
https://bugzilla.gnome.org/show_bug.cgi?id=590800
2009-10-24 17:20:50 +02:00
Kristian Rietveld
42ac226877 Bug 598881 - Unimplemented GdkWindowImplIface methods crash gimp on OSX
Add dummy for _gdk_input_window_crossing ().  Set both input_window_destroy
and input_window_crossing pointers in the Impl struct.

Reported by John Ralls.
2009-10-23 13:53:57 +02:00
Tor Lillqvist
861c34b01e Use correct type text/uri-list for the dropped files selection
Fixes bug #599321.
2009-10-23 13:40:27 +03:00
Javier Jardon
98ea183c13 Use G_STRLOC instead __FILE__ and __LINE__
Patch from bug #599225
2009-10-21 21:48:00 +03:00
Javier Jardón
d3155bb1ea Remove some unnused variables 2009-10-20 20:37:46 +02:00
Tor Lillqvist
ab13c00a38 Use correct size for root window with multiple monitors
The root window width and height have already been correctly
initialised in _gdk_root_window_size_init() to cover all monitors, so
don't incorrectly re-initialise using GetSystemMetrics(SM_C[XY]SCREEN)
which only gives the size of the primary monitor anyway. (See MSDN.)

This fixes at least gdk_screen_get_{width,height}() which indirectly
affects at least the positioning of combo box pop-up menus on multiple
monitors.
2009-10-18 14:35:17 +03:00
Tor Lillqvist
0698ddd421 Delete a couple of leftover commented-out lines 2009-10-18 14:19:55 +03:00
Tor Lillqvist
77590e9af7 Add missing newline to debugging output 2009-10-18 14:19:24 +03:00
Tor Lillqvist
be5c06d799 Delete unused leftover static function 2009-10-18 12:08:18 +03:00
Tor Lillqvist
f545bd270d More meaningful debugging output in gdk_win32_window_get_root_coords 2009-10-18 12:06:29 +03:00
Tor Lillqvist
d8de422794 Remove unused variables and static functions 2009-10-18 11:51:57 +03:00
Tor Lillqvist
b92f882ec4 Correct function names in debugging output 2009-10-18 11:45:03 +03:00
Javier Jardón
57bc513713 Use g_object_ref/unref instead deprecated gdk_*_ref/unref functions
Substitute deprecated reference counting functions for
g_object_ref/unref in documentation and in internal code

https://bugzilla.gnome.org/show_bug.cgi?id=598217
2009-10-14 03:13:52 +02:00
Alexander Larsson
786b589d95 Fix up _gdk_windowing_window_at_pointer coordinate reporting
We need to do a final XQueryWindow to get the coordinates inside the
windows rather than in the parent window.

This fixes bug #597386, "Cannot click buttons more than once...", which
failed due to the grab tracking stuff getting the wrong coordinates as
per the above.
2009-10-05 11:41:50 +02:00
Matthias Clasen
4581432387 Plug a memory leak
Valgrind reported a leak of regions from gdk_window_process_updates_internal.
2009-10-04 22:35:12 -04:00
Sebastian Dröge
59177b1932 Bug 596959 - DirectFB backend compilation broken with changes from 2.18.0 to 2.18.1
Fix compilation of the DirectFB backend after internal API changes of GDK.
2009-10-02 07:39:34 +02:00
Pascal Terjan
f3013bf6ed Call XReconfigureWMWindow with proper screen
Thanks gcc :

gdkwindow-x11.c:1731: warning: passing argument 3 of
'XReconfigureWMWindow' makes integer from pointer without a cast
/usr/include/X11/Xlib.h:1871: note: expected 'int' but argument is of
type 'struct GdkScreen *'

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
2009-10-01 18:36:43 +02:00
Kristian Rietveld
a4145bfeef Bug 588449 - DnD doesn't work on GDK/Quartz
Patch from Paul Davis.  This gets the basics of drag and drop properly
working on Mac OS X.
2009-09-30 15:07:37 +02:00
Kristian Rietveld
28d56cbbda Use boxed accessors for setting and retrieving cursor property 2009-09-30 13:00:28 +02:00
Thomas Jaeger
35845f1efe Interpret min_value == max_value correctly
https://bugzilla.gnome.org/show_bug.cgi?id=588649

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
2009-09-30 09:21:12 +02:00
Thomas Jaeger
70bd23537f Select for DeviceStateNotify
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-30 09:21:11 +02:00
Thomas Jaeger
0178ebf739 Keep track of axis values
https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-30 09:21:10 +02:00
Thomas Jaeger
67728ac004 Filter out events that the current window didn't select for
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:25 +02:00
Thomas Jaeger
51f2a99096 Always select all XInput motion events
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:23 +02:00
Thomas Jaeger
acdecb6aa4 Report XInput button motion events until all buttons are released.
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:21 +02:00
Thomas Jaeger
2635fb75c6 XInput allows up to 255 buttons
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:18 +02:00
Thomas Jaeger
abf7742beb Refactor _gdk_input_other_event
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:17 +02:00
Thomas Jaeger
bd51d930e8 Use strstr instead of g_strrstr.
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
2009-09-29 12:58:52 +02:00
Alexander Larsson
6fef640deb Only select for button and pointer event on toplevels
These event types propagate up the hierarchy anyway, so this means
we avoid setting it unnecessarily. This is especially important
for button press event, since only one client can select for this
on each window, causing X errors if two clients do it.
2009-09-29 12:58:42 +02:00
Thomas Jaeger
7d196b3939 Improve detection of input device source type
This detection code is not 100% reliable, but it should fare much better
than the current code, which just compares the device name to a fixed
set of strings.  Many applications depend on erasers being recognized
reliably, so we start by checking for a device name containing the
substring 'eraser'.

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
2009-09-28 16:08:42 +02:00
Alexander Larsson
e81501ebea Sent button events don't cause passive grabs
Don't track sent button events as causing or removing
passive grabs.
2009-09-28 15:29:37 +02:00