Commit Graph

4909 Commits

Author SHA1 Message Date
Rob Bradford
0d1ae2e0dd wayland: Protocol change: wl_shell_surface_* take surfaces for parents
These functions used to take shell_surface objects and now take surface
objects the parents.
2012-07-12 15:58:38 +01:00
Rob Bradford
8d7869ecbb wayland: Remove unused variable 2012-07-12 15:58:38 +01:00
Rob Bradford
598c1b27fe wayland: Temporary disable/hackaround keyboard code 2012-07-12 15:58:38 +01:00
Rob Bradford
f20ac38315 wayland: Port to SHM pool allocation mechanism 2012-07-12 15:58:38 +01:00
Rob Bradford
3eb0b195ed wayland: Port to new input protocol mechanism
This replaces the wl_input_device with wl_pointer, wl_keyboard, wl_touch all
tied together under a wl_seat.

This is quite a radical change in protocol and for now keyboard handling is
disabled.
2012-07-12 15:58:38 +01:00
Rob Bradford
b1a5b19b4a wayland: Load cursor theme using new Wayland cursor library
This requires the SHM object be initialised - therefore this is the most
logical (if slightly ugly place.)

We also need to make sure that we do something clever to load the correct
cursor theme.
2012-07-12 15:58:38 +01:00
Rob Bradford
2928ffc7b1 wayland: Remove unhelpful debug message 2012-07-12 15:58:37 +01:00
Rob Bradford
936ceb84b5 wayland: Protocol change: ping event on shell_surface 2012-07-12 15:58:37 +01:00
Rob Bradford
a9dc48ce94 wayland: Update to new header path for xkbcommon 2012-07-12 15:58:37 +01:00
Phil Clayton
bd3e3974c9 Change signal parameter names in GdkWindow to be valid C identifiers
https://bugzilla.gnome.org/show_bug.cgi?id=679228
2012-07-11 07:24:47 -04:00
Chun-wei Fan
fd6ce9975e Bug 676077: Fix handling of Keyboard Input on Windows
Don't use ASCII control characters to denote the input of Esc, Tab,
Return/Enter, Backspace and Delete, as it seems that it is not how
Windows handle them, and they cause weird characters to appear in the
input field on GTK+3 programs in non-English Windows.  Instead, let
these keys be handled as-is on Windows, like what is done in GTK+-2.x.

Checked with mclasen on IRC, and thanks to the people who verified the
patch to not break anything on English Windows.
2012-06-25 23:23:01 +08:00
Matthias Clasen
116b5e560f GdkDevice: Fix an inverted assertion
gdk_device_list_slave_devices only makes sense to call on master
devices, yet its g_return_if_fail check made it reject such devices.

Pointed out by monty.
2012-06-20 22:44:32 -04:00
Руслан Ижбулатов
bba72eae50 Fix windres invocation
Signed-off-by: Chun-wei Fan <fanchunwei@src.gnome.org>
2012-06-19 12:16:15 +08:00
Torsten Schönfeld
61972a3f8d gdk: annotate the attributes_mask type for gdk_window_new
https://bugzilla.gnome.org/show_bug.cgi?id=670369
2012-06-11 22:34:35 +02:00
Torsten Schönfeld
ab976ac8c1 gdk: add a missing annotation to GdkEventProperty
Its 'state' field is of type GdkPropertyState.

https://bugzilla.gnome.org/show_bug.cgi?id=677775
2012-06-10 22:22:19 +02:00
Torsten Schönfeld
e6149931c9 gdk: add missing annotations to gdk_event_get_scroll_deltas
https://bugzilla.gnome.org/show_bug.cgi?id=677774
2012-06-10 22:21:32 +02:00
Matthias Clasen
f27ed9ae80 Correct the docs for GDK_MSB_FIRST
https://bugzilla.gnome.org/show_bug.cgi?id=571254
2012-05-26 14:40:12 -04:00
Emmanuele Bassi
11aac235bc docs: Escape bare '#' in GdkRGBA string definitions
GTK-Doc does not like bare '#', so let's turn them into &num;.
2012-05-20 13:45:05 +01:00
Matthias Clasen
5a47f22f5b Add since annotations to some enum values
The things related to touch and smooth scrolling were 3.4 additions,
so mark them as such.

https://bugzilla.gnome.org/show_bug.cgi?id=676329
2012-05-19 12:20:58 -04:00
Natanael Copa
d6aee922bb Bug 676087-configure.ac: isnan() and isinf() are macros, not functions
The isnan() and isinf() are C99 macros not functions so use
AC_CHECK_DECL instead of AC_CHECK_FUNCS for those.
2012-05-16 23:55:40 -04:00
Matthias Clasen
16458b0de2 Fix a case of 'stuck grab'
This was showing up when using a combo box in list mode. After popping
up the list, the keyboard grab appeared stuck. What was stuck here is
only the client-side grab, since we forgot to clean up our grabs
when receiving an UnmapNotify.

This bug was introduced in 1c97003664.
2012-05-16 17:34:36 -04:00
Cosimo Cecchi
7babd3847a gdk: fix the build
Regression from commit 861c57e304
2012-05-15 13:27:21 -04:00
Bastien Nocera
861c57e304 gdkoffscreenwindow: Don't crash when resetting cursor
When the toplevel is a GdkOffscreenWindow which doesn't
implement the set_device_cursor() vfunc, we would have
crashed. Implement a dummy ->set_device_cursor vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=675809
2012-05-15 18:05:36 +01:00
Bastien Nocera
0c6b54aa44 Revert "gdk: Don't crash when resetting cursor"
Patch didn't get reviewed yet.

This reverts commit 779591b62f.
2012-05-15 17:57:33 +01:00
Bastien Nocera
779591b62f gdk: Don't crash when resetting cursor
When the toplevel is a GdkOffscreenWindow which doesn't
implement the set_device_cursor() vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=675809
2012-05-15 17:49:33 +01:00
Edward Sheldrake
f77b690e26 GDK X11 DND: Fix infinite loop
Related: https://bugzilla.gnome.org/show_bug.cgi?id=664646
2012-05-14 23:02:23 -04:00
Kristian Rietveld
d4b38c5806 quartz: Ignore events from all mouse buttons past the resize boundary
Before, right click events were still let through into GDK. In this
case, also middle/right button events with x-coordinates in the range
[-3, 0] are processed, resulting in failures/crashes in the window
finding code because no GdkWindows are present in this range.
2012-05-13 18:20:12 +02:00
Alexander Larsson
859b6888c7 [broadway] Fixup build
Seems the return value of device_query_state was removed, it was
TRUE always anyway.
2012-05-11 14:49:15 +02:00
Michael Natterer
7915388017 quartz: handle yet another dead tilde variant
which is delivered by the US-International keyboard layout.
2012-05-08 16:07:31 +02:00
Benjamin Otte
78638f798b broadway: Fix vfunc prototype 2012-05-07 04:12:29 +02:00
Marc-André Lureau
4884a7c1af gdk: do not send leave event on touchpad button release
This is along the changes introduced in
bd55519f7e,
A TOUCHPAD device behaves like a mouse"

https://bugzilla.gnome.org/show_bug.cgi?id=674549
2012-05-05 14:39:37 -04:00
Bastien Nocera
c1f01eb929 Add support for disabling middle click paste
Adds a gtk-enable-primary-paste setting that is backed by
and X setting, and make GtkEntry and GtkTextView respect it.

https://bugzilla.gnome.org/show_bug.cgi?id=665243
2012-05-03 21:59:54 -04:00
Dan Winship
154ce014a8 gdk: add bindings-friendly alias for GDK_EVENT_2BUTTON_PRESS
GDK_EVENT_2BUTTON_PRESS and GDK_EVENT_3BUTTON_PRESS can't be used from
some bindings because they'd translate to something syntactically
invalid. Add GDK_EVENT_DOUBLE_BUTTON_PRESS and
GDK_EVENT_TRIPLE_BUTTON_PRESS aliases to work around that.

https://bugzilla.gnome.org/show_bug.cgi?id=671025
2012-05-03 21:22:39 -04:00
Matthias Clasen
823ee6d529 Fix unclosed comments 2012-05-03 16:11:14 -04:00
Chun-wei Fan
a5626c489e Bug 670499-gdk/gdkrgba.c: Include fallback-c89.c
Include (gdk/)fallback-c89.c as isnan() and isinf() is used.
2012-05-03 11:55:20 +08:00
Chun-wei Fan
4f56f53ad7 Bug 670499-Add gdk/fallback-c89.c
Add a fallback-c89.c for the gdk/ subdirectory as there is code that uses
functions that are introduced by C99.  This currently adds fallback
implementations for MSVC for isnan() and isinf()

Dist this "new" source file as well
2012-05-03 11:55:11 +08:00
Matthias Clasen
3be5c09a90 Add some more documentation about GDK_SCROLL_SMOOTH 2012-04-30 22:28:08 -04:00
Benjamin Otte
12846d821c versionmacros: min-require the current stable version
.. instead of the previous stable version.

This ensures that if we use GDK_DEPRECATED_IN_3_6, it will actually emit
a warning in GTK 3.5, and not wait with that until GTK 3.7. This is
particularly useful for stuff that gets deprecated right now. This code
should emit warnings right now, so we know what we're doing while
deprecating.
2012-05-01 03:13:01 +02:00
Benjamin Otte
7bb19b85c2 docs: Fix copy/paste typo 2012-05-01 03:13:01 +02:00
Owen W. Taylor
0aa989ae76 GtkPlug: fix handling of key events for different layouts
GtkPlug directly handles X KeyPress/Release events, instead of using
translation in GDK (which expects XI2 events for XI2). When this
was done, the handling of the group was stubbed out and never replaced.

Export gdk_keymap_x11_group_for_state() and gdk_keymap_x11_is_modifier()
so we can fill out the fields correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=675167
2012-04-30 16:35:10 -04:00
Mark Vender
d9eb667776 Regenerate the gdk/gdkkeysyms.h and gdk/gdkkeysyms-compat.h files
https://bugzilla.gnome.org/show_bug.cgi?id=673259
2012-04-25 20:29:36 -04:00
Mark Vender
d13740b2ba Fix the gdk/gdkkeysyms-update.pl to reflect new upstream location
https://bugzilla.gnome.org/show_bug.cgi?id=673259
2012-04-25 20:29:29 -04:00
Rob Bradford
af8e4ee8e7 wayland: Calculate window position offset to give emulated root coordinates
This allows combo box popup windows to appear in the correct place. This is a
workaround emulating root coordinates by calculating the offset for a chain
of windows that that are relative to each other.
2012-04-25 14:36:08 +01:00
Rob Bradford
568b310eb3 wayland: Only update position if the with_move flag is set
This was causing the combobox popup to be moved to (0,0) when just the
size was asserted.
2012-04-25 12:00:40 +01:00
Rob Bradford
55261f4e3f wayland: Improve error message handling in cursor buffer code 2012-04-25 12:00:40 +01:00
Sam Thursfield
2e873e3fdc Fix build with XInput < 2.2
Fixes regression introduced in fa8e6f7857
2012-04-24 12:55:39 +01:00
Cosimo Cecchi
8bb3a2001f xi2: ignore extraneous events for smooth scroll
Since the event will be ignored anyway after it's translated (slave
devices are disabled), don't let it run in the smooth scroll code path,
as it will burn our caches for the actual event we're interested in.

https://bugzilla.gnome.org/show_bug.cgi?id=673644
2012-04-22 13:06:39 -04:00
Cosimo Cecchi
37149668c0 xi2: fix thinko in variable type
https://bugzilla.gnome.org/show_bug.cgi?id=673644
2012-04-22 13:01:08 -04:00
Matthias Clasen
5a41b74c5c XI2: More logging for smooth scrolling
In addition to the delta, log device information.
This was triggered by
https://bugzilla.gnome.org/show_bug.cgi?id=673644
2012-04-22 13:00:47 -04:00
Rob Bradford
1aa2a7f821 wayland: Improve the error reporting in the Cairo GL surface code path 2012-04-19 17:59:09 +01:00
Rob Bradford
b5845514ec wayland: Improve error messages during SHM buffer creation
Use g_critical rather than fprintf and and also grab the error messages from
errno and from Cairo
2012-04-19 17:58:59 +01:00
Cosimo Cecchi
8febbcaf6a gdk: add missing GDK_VERSION_3_6 symbol 2012-04-18 13:23:29 -04:00
Rob Bradford
cd831b1390 wayland: Expose GdkWaylandDisplayManager as a public GType
This permits a runtime test of whether we are running on the Wayland platform
or not.
2012-04-17 18:40:41 +01:00
Rob Bradford
6f9ad538d9 wayland: Rename GdkScreenWayland to GdkWaylandScreen
This makes it consistent with the functions in the vtable and also consistent
with other backends.
2012-04-17 14:11:31 +01:00
Rob Bradford
fc58ff1e6a wayland: Rename GdkDisplayWayland to GdkWaylandDisplay
This makes it consistent with the functions in the vtable and also consistent
with other backends.
2012-04-17 14:11:31 +01:00
Benjamin Otte
a52336bedc gdk: Add deprecation/availability macros for 3.6 2012-04-17 08:59:07 +02:00
Kristian Høgsberg
ea78bcb7c5 wayland: Prefer X11 backend over Wayland
https://bugzilla.gnome.org/show_bug.cgi?id=674102
2012-04-16 18:53:54 +02:00
Rob Bradford
71ca53993e wayland: Use an ARGB buffer for the Cairo and SHM surface 2012-04-16 15:09:14 +01:00
Rob Bradford
cddfcf1418 wayland: Force an expose for the whole area when scrolling 2012-04-16 15:09:14 +01:00
Rob Bradford
cdf5c2af62 wayland: Add support for rendering into an SHM buffer with Cairo image backend
The first version of this change included a bug that meant that if you don't
compile for any other backend then it wouldn't search for cairo. Credit for
identifying the bug goes to darxus@chaosreigns.com.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=672361
2012-04-16 15:09:14 +01:00
Rob Bradford
6977ea0bd1 wayland: Move the buffer creation to the cairo surface creation 2012-04-16 14:12:51 +01:00
Rob Bradford
d9ca1a8636 wayland: Move the finalize function to allow a clear logical block of code 2012-04-16 14:12:51 +01:00
Rob Bradford
a8d03c9970 wayland: Remove unused member from struct 2012-04-16 14:12:51 +01:00
Matthias Clasen
050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Pavel Holejsovsky
94116aec8e Fix sourcedir!=builddir .gir build from source tarball
Setting -I$(top_builddir) before -I$(top_srcdir) causes that
g-ir-scanner picks up boxing definitions generated by glib-mkenums.

https://bugzilla.gnome.org/show_bug.cgi?id=672133
2012-04-11 20:05:10 +02:00
Kristian Rietveld
7e778aa033 [quartz] Fix manual resizing of windows
In the Quartz backend, there are two methods by which windows are
resized. The first method is fully handled by Quartz and does not appear
in the event stream the application resizes. The second method is when
we resize windows by ourselves. In OS X this happens when a GTK+ resize
grip is used. This resize grip is larger than the Quartz resize grip.
When the resize is started outside the "Quartz area", we have to handle
it by ourselves.

This patch fixes this manual window resizing by ignoring events while we
are in the process of resizing (such that the events actually arrive at
the sendEvent handler of GdkQuartzWindow where this resize is handled).
When the resize has finished we break all grabs such that GDK is not
stuck thinking the cursor is still in the resize window.
2012-04-10 21:54:03 +02:00
Kristian Rietveld
d5ac2bd372 Export break_all_grabs() within Quartz backend
Function was renamed to _gdk_quartz_events_break_all_grabs().
2012-04-10 21:50:07 +02:00
Benjamin Otte
826360a214 x11: Add suggested braces around empty body in 'if' statements 2012-04-07 13:01:24 +02:00
Matthias Clasen
2ef4b930c7 Don't force BUTTON1_MASK on non-touch events
This problem was pointed out by Hans de Goede in
https://bugzilla.gnome.org/show_bug.cgi?id=673458
2012-04-06 20:25:21 -04:00
Matthias Clasen
432f0151eb xi2: Remove touchscreen heuristics
It doesn't make sense to consider a device a touchscreen if it
doesn't have any touch classes. Even if it has 'touch' in its
name.
https://bugzilla.gnome.org/show_bug.cgi?id=673440
2012-04-06 20:00:35 -04:00
Rui Matos
7b0fd635fa x11: Don't ignore button releases after a wmspec move/resize
_gdk_x11_moveresize_configure_done() isn't called for wmspec
moves/resizes so we don't have a way to notice when a wmspec
move/resize ends and consequently untrigger the sending of
_NET_WM_MOVERESIZE_CANCEL which results in this message always being
sent on the next button release event. In that case we are marking
that event as handled so it isn't processed further which breaks
button press/release event handling in several widgets.

To fix this we simply allow the normal event handling machinery to run
after sending the _NET_WM_MOVERESIZE_CANCEL message.

https://bugzilla.gnome.org/show_bug.cgi?id=673328
2012-04-05 10:12:16 +02:00
Rui Matos
987baaba5c x11: Set GdkToplevelX11.have_focused on creation
Since the order in which _NET_WM_STATE and _NET_WM_DESKTOP are set, or
even *if* they are set, isn't defined, we could end up unsetting
GDK_WINDOW_STATE_FOCUSED given that both handlers for these two X
properties end up doing window state changes for all states. As we
want GDK_WINDOW_STATE_FOCUSED to be set by default we need to set its
master flag by default as well.

https://bugzilla.gnome.org/show_bug.cgi?id=673125
2012-04-04 17:14:06 +02:00
Alexander Larsson
c5a8f3cb61 gdk: Remove GdkDisplay->ignore_core_pointer
This is not used anywhere anymore
2012-04-03 11:37:42 +02:00
Alexander Larsson
24f9ca92ab win32: Fix up wintab support
We now have a proper MASTER/SLAVE input device split, where
the masters are virtual core input devices and we add fake hw
slave devices for the system pointer and real slave devices for
wintab devices.

We also set the proper source_device on the events so you can
tell which device sent it and properly decode the axis info.
2012-04-03 11:37:42 +02:00
Alexander Larsson
ddd24761fd Add _gdk_device_get_axis_info
This is needed for the win32 master/slave handling code.
2012-04-03 11:37:41 +02:00
Matthias Clasen
88a1d4d5a1 x11: Deal better with L-shaped monitor arrangements
The code for calculating the per-monitor workarea was ignoring
the fact that the EWMH workarea property can only handle rectangular
workareas, and thus can't really do justice to general monitor
arrangements. As a workaround, we ignore it for anything but
the primary monitor. And we ignore it for the primary monitor
as well if it does not even cover it.

https://bugzilla.gnome.org/show_bug.cgi?id=672163
2012-03-23 09:09:14 -04:00
Benjamin Otte
bd55519f7e gdk: A TOUCHPAD device behaves like a mouse
and not like a TOUCHSCREEN. So treat it like that.

https://bugzilla.gnome.org/show_bug.cgi?id=672009
2012-03-20 02:07:29 +01:00
Mathias Hasselmann
ebc2bda82b wayland: hide predefined_atoms
This is a private symbol and should not be public.
2012-03-16 22:45:51 +01:00
Alexander Larsson
6d99cdf28c win32: Ensure we update GDK_WINDOW_STATE_FOCUSED
When windows get activated/inactivated we need to update STATE_FOCUSED.
Without this the backdrop theme state will not work.
2012-03-16 11:34:58 +01:00
Bastien Nocera
5c22e0a11e gdk: Update translator comment for "keyboard label" 2012-03-15 16:05:00 +01:00
Matthias Clasen
de62a1096b Drop support for pre-R6 X
X11 R6 was released in 1995 - time to let go.
2012-03-10 23:27:21 -05:00
Matthias Clasen
82041de9b5 Drop unneeded XI2 defines
The X headers don't use these defines anywhere.
2012-03-10 23:13:19 -05:00
Kalev Lember
526fc2fbdb win32: Finish making query_state() vfunc a void vfunc
Commit 114b45c converted all the backends but missed a few details in
gdkdevice-win32. This fixes it up.
2012-03-10 13:40:42 +02:00
Benjamin Otte
02f9d51177 gdk: clean up logic error
Fallout from previous query_state() cleanups.
2012-03-09 12:36:11 -05:00
Benjamin Otte
114b45c7eb gdk: Make query_state() vfunc a void vfunc
... and make sure the backends implement it that way.

query_state() return value was ignored in all of GDK and caused crashes
when it failed.
2012-03-09 13:23:05 +01:00
Matthias Clasen
9d1688680c xi2: Don't reset scroll valuators too often
According to XInput gurus, a motion event without valuators
does not invalidate the stored value, so we should keep it.

https://bugzilla.gnome.org/show_bug.cgi?id=671659
2012-03-08 22:35:43 -05:00
Benjamin Otte
858a654676 x11: Avoid spurious focus events on grabs
We want to avoid handling focus events for the private focus window,
otherwise the keyboard grab taken by for example buttons will cause a
spurious FOCUS_OUT/FOCUS_IN on the toplevel.

The code that did this seems to have been lost in the XI2 transition for
GTK3.

This patch reapplies db4a6040af which was
backed out in 18406b7b04 to give
developers a chance to get their X servers fixed. As we want to get this
bugfix in for 3.4, we need to commit it now.

https://bugzilla.gnome.org/show_bug.cgi?id=657578
2012-03-07 15:35:21 +01:00
Rob Bradford
c6b0e91e87 wayland: Add some useful comments explaining the cairo surface behaviour 2012-03-06 21:24:41 +00:00
Rob Bradford
ff2acecac6 wayland: Add NULL warning check to _gdk_wayland_window_set_device_grabbed 2012-03-06 21:24:41 +00:00
Rob Bradford
99e0f4b62c wayland: Don't try and reset the pointer window grab if there wasn't one 2012-03-06 21:24:41 +00:00
Alexander Larsson
7430559736 win32: Remove some unused input stuff to make win32 build again
Input events doesn't quite seem to work though, so it needs some fixing.
2012-03-06 12:04:36 +01:00
Matthias Clasen
404359f2dd Fix symbol lists 2012-03-05 08:09:39 -05:00
Matthias Clasen
aa60e02795 gdk: Remove an unused enumeration
We don't have any API using the GdkExtensionMode enumeration, so
no point in carrying it in the headers.
2012-03-04 20:05:42 -05:00
Matthias Clasen
3dd5e88c07 xi2: Normalize scroll deltas
XI2 provides us with an increment for each scroll valuator,
and by dividing the delta by the increment, we obtain normalized
values in some abstract 'scroll unit'.

For mouse wheels, the evdev driver reports an increment of -1,
so doing this division fixes the inverted scrolling with wheels
that we've seen recently.
2012-03-04 19:12:27 -05:00
Matthias Clasen
0e07d6589e gdk: Don't drop the emulating_pointer flag
When manually copying touch events, we must not forget the
emulating_pointer flag.
2012-03-04 11:24:51 -05:00
Bastien Nocera
f3b899fc83 x11: Simplify XI2 mods state
https://bugzilla.gnome.org/show_bug.cgi?id=671070
2012-03-04 01:12:06 -05:00
Bastien Nocera
deea79f4e4 x11: Correct GroupSwitch mask
base | latched | locked is incorrect for the group mask,
and the clamping has already been applied.

https://bugzilla.gnome.org/show_bug.cgi?id=671070
2012-03-04 01:12:06 -05:00
Matthias Clasen
88ebe2285f gdk: Emulate motion events when requested
GtkRange was using GDK_POINTER_MOTION_MASK, and it was not
getting any emulated motion events, because we only translate
from GDK_BUTTON_MOTION_MASK to GDK_POINTER_MOTION_MASK, but not
the other way around, and emulated_mask only had
GDK_BUTTON_MOTION_MASK in it. Now we put GDK_POINTER_MOTION_MASK
in emulated_mask and successfully match for windows that
have GDK_POINTER_MOTION_MASK or any of the button motion masks
selected.

This fixes range sliders not following the finger and jumping
to the last position upon release.
2012-03-02 23:33:16 -05:00
Matthias Clasen
9687ac33b8 xi2: Add some more debug output about scroll devices 2012-03-02 23:02:57 -05:00
Mikael Magnusson
1c97003664 Iconification using _NET_WM_STATE_HIDDEN hint if supported by WM
If the Window Manager supports the _NET_WM_STATE_HIDDEN, we use it to use
the _NET_WM_STATE protocol when de-iconifying windows (iconification is
unchanged, via XIconifyWindow). Additionally, we no longer interpret all
UnmapNotify events for our window as the result of iconification.

(Based on patch by Tomas Frydrych <tf@linux.intel.com>)
2012-03-02 20:36:28 +01:00
Paolo Borelli
1a75eff9a9 Annotate gdk_window_get_frame_extents
"rect" is an output parameter
2012-03-02 18:58:03 +01:00
Matthias Clasen
482f04c89c xi2: add some debug output for smooth scroll events 2012-03-02 09:57:53 -05:00
Javier Jardón
962a5d8b8a Require XInput2.h in X11 backend
Also remove support for XInput.h
2012-03-02 12:52:12 +00:00
John Ralls
d859c921c5 Quartz: Fix incompatible types in assignment
NSEvent -scrollingDeltaX and -scrollingDeltaY aren't defined before
10.7, so objc assumes that they return a pointer. Trying to cast to a
float generates a compiler error.
2012-03-01 17:00:35 -08:00
Matthias Clasen
352fdc214a Fix build with XI2.x for x < 2 2012-03-01 16:45:23 -05:00
Carlos Garnacho
013da47a07 gdk,xi2: Ensure scroll valuators are reset on window/device switch
This is in order to avoid scrolling glitches as the device causing
scrolling to happen or the Window receiving the events changes.
2012-03-01 16:29:01 -05:00
Carlos Garnacho
147cdd8465 devicemanager,xi2: Implement smooth scrolling
XInput >= 2.1 allows for implementing smooth scrolling,
reporting the different scrolling axes as valuators.
Any change in those will be reported as GdkEventScroll
events with delta_x/y information.

the older kind of scroll events is still handled, and
emulated in devices able to provide smooth scrolling,
setting _gdk_event_set_pointer_emulated() in that case.
2012-03-01 16:28:58 -05:00
Carlos Garnacho
f941c78969 devicemanager,x11: Initialize event->scroll.delta_x/y to 0 on core events 2012-03-01 16:28:58 -05:00
Michael Natterer
d0b032e3be quartz: Implement smooth scrolling
nsevent scrollingDeltaX/Y (available on OSX >= Lion) is used to
provide the smooth scrolling values. In any case, old fashioned
events are still sent, setting _gdk_event_set_pointer_emulated()
if the event contains both smooth and non-smooth values.
2012-03-01 16:28:58 -05:00
Carlos Garnacho
77cbc98044 gdk: update csw event mask filter to handle smooth scroll
Events of type GDK_SCROLL will be received if the client side window
event mask has either GDK_SCROLL_MASK or GDK_SMOOTH_SCROLL_MASK.

GDK_BUTTON_PRESS_MASK has been removed from type_masks[GDK_SCROLL]
as that bit is often set for other-than-scrolling purposes, and
yet have the window receive scroll events. In GTK+, this forces
non-smooth events bubbling, even if the widgets above want smooth
events, and legitimately set GDK_[SMOOTH_]SCROLL_MASK.
2012-03-01 16:28:57 -05:00
Carlos Garnacho
b177bd92aa gdk: Filter out either smooth or non-smooth event depending on the evmask
If a device provides both smooth and non-smooth events, the latter will be
flagged with _gdk_event_set_pointer_emulated() so the client side window
receives one or the other. If a device is only able to deliver non-smooth
events, those will be sent, so both direction/deltas may need to be handled.
2012-03-01 16:28:57 -05:00
Carlos Garnacho
4b1e16cac6 gdk: Add GDK_SMOOTH_SCROLL_MASK
By setting this event, a GdkWindow will receive scroll events
that provide delta values.
2012-03-01 16:28:57 -05:00
Michael Natterer
c41b52b4f6 gdk: transfer event->scroll.delta_x/y through csw 2012-03-01 16:28:57 -05:00
Carlos Garnacho
f47e470e58 gdk: deal with GDK_SMOOTH_SCROLL events as not having a direction
gdk_event_get_scroll_direction() will return FALSE on these, so
gdk_event_get_scroll_deltas() has to be used to retrieve dx/dy
2012-03-01 16:28:57 -05:00
Michael Natterer
0efbbc6435 gdk: Add delta_x/y to scroll events
gdk_event_get_scroll_deltas() can be used to retrieve those
values on smooth scroll events.
2012-03-01 16:28:56 -05:00
Carlos Garnacho
7b48a3c0bd gdk: Add GDK_SCROLL_SMOOTH to GdkScrollDirection
This value will be used for smooth scroll events, as they'll
express the scrolling direction in terms of dx/dy.
2012-03-01 16:28:56 -05:00
Carlos Garnacho
28e7d3c148 gdk: Get the right event window for pointer emulated events
get_event_window() just checked on GDK_TOUCH_MASK, including for emulated
pointer events, so at the very least those should also match evmasks with
no touch events whatsoever
2012-03-01 16:25:28 -05:00
Carlos Garnacho
0bb2e6f264 gdk: Set correct GdkModifierType on pointer emulated events 2012-03-01 16:25:27 -05:00
Carlos Garnacho
fcbcac0ca3 gdk: translate correctly from touch events into emulated pointer events 2012-03-01 16:25:27 -05:00
Matthias Clasen
11fdf1667c gdk: Don't treat touch events as button events
One more place where we assumed that touch events have a button
field.
2012-03-01 16:25:27 -05:00
Matthias Clasen
3880b12196 gdk: Use the last alive grab in order to get the event window
If an active grab kicks in on a different window, _gdk_display_has_device_grab()
would still find the former implicit grab for the window below the pointer, thus
sending events to an unrelated place.
2012-03-01 16:25:27 -05:00
Carlos Garnacho
9c6f71bfc7 gdk: Don't mutate pointer events to touch events just because a grab says so
If a grab with GDK_TOUCH_MASK kicks in due to a touch sequence emulating pointer
events, don't mutate the sequence into emitting touch events right away.
2012-03-01 16:25:27 -05:00
Carlos Garnacho
5942fee240 gdk: Let implicit touch grabs coexist with an implicit pointer grab
Create the backing GdkTouchGrabInfo for touches even if the pointer
emulating touch sequence is already holding an implicit grab on a
window that didn't select for touch events.
2012-03-01 16:25:26 -05:00
Carlos Garnacho
b897ba0cd8 gdk: Don't fully destroy the implicit touch grab on ::grab-broken
the backing GdkTouchGrabInfo will be needed if the overriding device
grab finishes before the touch does in order to send events back to
the implicit grab window. Instead, wait until the touch is physically
finished before removing the matching GdkTouchGrabInfo
2012-03-01 16:25:26 -05:00
Carlos Garnacho
6efe116715 gdk: Listen to touch events by default on the native window
GDK will only receive touch events when dealing with a multitouch
device, so these must be transformed to pointer events if the
client-side window receiving the event doesn't listen to touch
events, and the touch sequence the event is from does emulate
the pointer.

If a sequence emulates pointer events, it will result in a
button-press, N motions with GDK_BUTTON1_MASK set and a
button-release event, and it will deliver crossing events
as specified by the current device grab.
2012-03-01 16:25:26 -05:00
Carlos Garnacho
0a80c26cdf gdk: Only trigger motion hints machinery on motion events
Touch events have no need for it, plus the concept behind
gdk_event_request_motions() doesn't wrap around multiple
touches within a device.
2012-03-01 16:25:26 -05:00
Carlos Garnacho
2f2774b7a9 gdk: Have touch grabs behave like the implicit grab wrt crossing events
These are equivalent to an implicit grab (with !owner_events), so
if the touch leaves or enters the grab window, the other window
won't receive the corresponding counter-event.
2012-03-01 16:25:25 -05:00
Carlos Garnacho
c72a77b04c gdk: handle implicit touch grabs
If the touch sequence happens on a window with GDK_TOUCH_MASK set,
a GdkTouchGrabInfo is created to back it up. Else a device grab is
only created if the sequence emulates the pointer.

If both a device and a touch grab are present on a window, the later
of them both is obeyed, Any grab on the device happening after a
touch grab generates grab-broken on all the windows an implicit
touch grab was going on.
2012-03-01 16:25:25 -05:00
Carlos Garnacho
b5cfdf2db4 gdk: Add internal API to deal with touch implicit grabs
The necessary information about a touch implicit grab is stored in
GdkTouchGrabInfo structs, these are meant to be transient to the
touch sequence.
2012-03-01 16:25:25 -05:00
Carlos Garnacho
b5de12debd gdk: Don't change window_under_pointer for pure touch events
Only touch events that emulate the pointer do change it.
2012-03-01 16:25:25 -05:00
Carlos Garnacho
8689921b90 gdk: Generate crossing events around touch devices' press/release
Anytime a touch device interacts, the crossing events generation
will change to a touch mode where only events with mode
GDK_CROSSING_TOUCH_BEGIN/END are handled, and those are sent
around touch begin/end. Those are virtual as the master
device may still stay on the window.

Whenever there is a switch of slave device (the user starts
using another non-touch device), a crossing event with mode
GDK_CROSSING_DEVICE_SWITCH may generated if needed, and the normal
crossing event handling is resumed.
2012-03-01 16:25:21 -05:00
Matthias Clasen
e5f7725fe0 gdk: Add some debug output for touch events and devices 2012-03-01 16:25:20 -05:00
Matthias Clasen
f7b7cc22e6 xi2: Translate touch events
Translate XI_TouchBegin/Update/End to GDK_TOUCH_BEGIN/UPDATE/END
events.

At the same time,
set pointer-emulated flags on button events with XIPointerEmulated
and on touch events emulating the pointer.
2012-03-01 16:25:20 -05:00
Carlos Garnacho
7f35708cee gdk: Add touch event types and mask
This commit introduces GDK_TOUCH_BEGIN/UPDATE/END/CANCEL
and a separate GdkEventTouch struct that they use. This
is closer to the touch event API of other platforms and
matches the xi2 events closely, too.
2012-03-01 16:25:20 -05:00
Carlos Garnacho
a490d2ebda gdk: Add internal API to set "pointer emulated" flag on events
This flag will be used for non-pointer events that are emulated
from eg. touch events, or pointer events being emulated.
2012-03-01 16:25:19 -05:00
Carlos Garnacho
bc8401d1ed gdk: Add GdkEventSequence
GdkEventSequence is an opaque pointer type that is used
to identify sequences of touch events that belong together.
2012-03-01 16:25:13 -05:00
Matthias Clasen
734c9056c6 xi2: Use the new device types for touch-capable devices
Any device with a XITouchClassInfo with num_touches > 0
qualifies as multitouch.
2012-03-01 16:19:57 -05:00
Matthias Clasen
7844f935b5 gdk: Add device types for touch-capable devices
We introduce GDK_SOURCE_TOUCHSCREEN and GDK_SOURCE_TOUCHPAD
for direct and indirect touch devices, respecively. These
correspond to XIDirectTouch and XIDependentTouch in XI2.
2012-03-01 16:19:57 -05:00
Carlos Garnacho
43a38de785 configure: Detect XInput 2.2 2012-03-01 16:19:57 -05:00
Carlos Garnacho
fbb0d8e546 xi2: Add major/minor properties to XI2 device manager
This may be used to turn on/off the features that are added to
new XInput2 revisions.
2012-03-01 16:19:57 -05:00
Alexander Larsson
fd0450b4e7 Fix up rendering of non-double-buffered overlays
My previous fix for this broke the progress bar in epiphany. This fix
makes it work again, and keeps the gimp bug fixed.

Basically, whenever we do a non-double-buffered rendering we have to
flush the entire window as it might be drawn outside the double
buffering machinery.
2012-03-01 14:14:33 +01:00
Benjamin Otte
6861bb8efc x11: Mark unused variables as such
We cannot get rid of the variables because they are assigned in a macro
inside Xlib. And this causes a warning in the xlib from Fedora 17
onwards.
2012-03-01 05:32:34 +01:00
Rob Bradford
8db9ba9e43 wayland: Categorise menus, popups and combo boxes as Wayland popup windows
Once we've made them popup windows we must also implement the popup_done event
handler on the shell surface listener. The best we can currently do is to hide
the window. This will then signal up to GTK which could then deactivate the
appropriate menu (see https://bugzilla.gnome.org/show_bug.cgi?id=670881)
2012-02-27 17:15:12 +00:00
Rob Bradford
bdca0520e6 wayland: Store the device that does a grab for a window on the window
This allows us to get the device if we need to make the window a popup. This
relies on the side effect that GTK calls into GDK to take a grab before the
popup window is shown.
2012-02-27 17:15:12 +00:00
Rob Bradford
161b9d2066 wayland: Call wl_shell_surface_set_{popup,transient,toplevel} before attach
The requests only have an effect if you call them before the buffer is
attached to the surface.
2012-02-27 17:15:12 +00:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Cosimo Cecchi
6f34ac4ba0 gdk: don't install gdkversionmacros.h twice
Since it's generated, we install the header by putting it into
gdkinclude_HEADERS, so it's wrong to put it again into
gdk_public_h_sources.
This fixes the build.
2012-02-27 11:45:12 -05:00
Matthias Clasen
f6d8c8a717 Add some documentation around deprecations 2012-02-27 07:56:29 -05:00
Matthias Clasen
98f3468172 gdk: correct a 'Since' note in the docs
gdk_keymap_get_modifier_state was only introduced in 3.4, not 3.2.
2012-02-27 07:11:43 -05:00
Matthias Clasen
d36c10bc03 gdk: Use versioned deprecations
This patch changes all uses of GDK_DEPRECATED(_FOR) in gdk headers
by the versioned variants, GDK_DEPRECATED_IN_3_x(_FOR). At the same
time, we add GDK_AVAILABLE_IN_3_x annotations for all API additions
in 3.2 and 3.4.
2012-02-27 07:11:43 -05:00