Commit Graph

4474 Commits

Author SHA1 Message Date
Matthias Clasen
b3e13bd0a8 Drop use of GDK_DISABLE_DEPRECATED guards in gdk
We now use function attributes for deprecation so the build-breaking
guards are no longer needed.
2011-11-09 22:01:00 -05:00
Matthias Clasen
b6ae763e25 Drop references to g_thread_init()
We are already requiring GLib 2.31, so g_thread_init() is never
needed anymore.
2011-11-09 18:36:35 -05:00
Michael Natterer
5ca2f06893 quartz: include all buttons' state in GdkEventMotion.state
(cherry picked from commit 3b5c5710da)
2011-11-09 00:36:21 +01:00
Michael Natterer
5f6c70f211 quartz: include all buttons' states in GdkEventButton.state
(cherry picked from commit a381e8ea62)
2011-11-09 00:26:30 +01:00
Michael Natterer
264241eb11 Bug 663605 - Fix event->state of many event types on quartz
Don't try to remember the current keyboard modifier and mouse button
states from the last event, because that isn't always right, and don't
set event.state = 0 for generated events. Instead, add private functions
to get the current states, and implement them with API that retrieves
these states independently from an event.
2011-11-08 21:52:49 +01:00
Rui Matos
95648fd194 x11: Implement GDK_WINDOW_STATE_FOCUSED on top of _NET_WM_STATE_FOCUSED
_NET_WM_STATE_FOCUSED is a new _NET_WM_STATE hint which allows us to
implement a meaningful GDK_WINDOW_STATE_FOCUSED under X11. If the window
manager doesn't support this hint we keep GDK_WINDOW_STATE_FOCUSED set since
that is what gtk+ implicitly assumed historically.

https://bugzilla.gnome.org/show_bug.cgi?id=661428
2011-11-08 19:33:22 +00:00
Rui Matos
43f1b5abbc gdk: Add GDK_WINDOW_STATE_FOCUSED to GdkWindowState
This state means that the toplevel window is presented as focused to the user,
i.e with active decorations under an X11 window manager.

If the GDK backend doesn't implement this flag, it will just remain set after
mapping the window.

https://bugzilla.gnome.org/show_bug.cgi?id=661428
2011-11-08 19:25:51 +00:00
Michael Natterer
ac943bf69a gdk: exclude MOD1 from the virtual modifier mapping
which effectively nails down the MOD1 == ALT assumption that is valid
in all other parts of GTK+. After the modifier abstraction fixes for
OSX, the virtual mapping is now (correctly) used in more places, and
caused problems with the common default PC keyboard layout on X11 that
colocates ALT and META on the same key.
2011-11-07 20:09:00 +01:00
Michael Natterer
d1c6bcb85c quartz: handle recursive CFRunLoops
Fixes e.g. crashs when dropping from finder.

Turn the "getting_events" boolean into a counter to handle poll_func()
being called recursively, and track the loop depth correctly by
changing its counter before bailing out in run_loop_observer_callback().
This way we reallocate our autorelease pool at the right time, and
don't kill memory that is still in use by outer run loops.

Also drain, not release the pool, just for some defensive forward
compatibility.
(cherry picked from commit ef9a92d225)
2011-11-06 23:38:50 +01:00
Kristian Rietveld
88329aeff4 quartz: use get_toplevel_from_ns_event in one more place
Fixup needed due to refactoring in GTK+-3.0.
2011-11-06 10:36:00 +01:00
Kristian Rietveld
b78658c310 quartz: make gdk_quartz_osx_version conform to coding style 2011-11-06 10:17:46 +01:00
Kristian Rietveld
e5ccae5782 quartz: make test_resize () conform to coding style 2011-11-06 10:16:27 +01:00
Kristian Rietveld
9f45c37be7 quartz: Process motion events within windows bounds without window set
When an NSEvent does not have the window field set, we already assumed
the event was not for us and discarded it.  But for NSMouseMoved events
we now make an exception, because such events generated after
using/clicking the main menu bar have the window field set to NULL while
the application window still has focus.

We used to experience a loss of motion events after using the menu bar,
this could be seen in buttons that stopped prelighting and first
clicks often being ignored unless you clicked somewhere else first.
These issues are fixed by this patch.
2011-11-06 10:15:16 +01:00
Kristian Rietveld
7269cdf315 quartz: Factor out toplevel from NSEvent code into function 2011-11-06 10:12:24 +01:00
Kristian Rietveld
6a7280ce1a quartz: Separate out screen_point conversion in function
Reduces code duplication and confusion.
2011-11-06 10:10:12 +01:00
Kristian Rietveld
4d9d8ba96d quartz: remove unused variable 2011-11-06 10:04:39 +01:00
Rui Matos
8067f6b886 x11: Fix window manager change detection
Since the wmspec_check_window doesn't have a corresponding GdkWindow we can't
rely on the get_event_window() return value to get the XID from. Just use the
XID from the XEvent directly.

https://bugzilla.gnome.org/show_bug.cgi?id=662953
2011-11-05 01:37:37 -04:00
Matthias Clasen
3b152df48a Wayland: Adapt to GdkWindowImpl api change 2011-11-05 01:12:26 -04:00
Matthias Clasen
810ef68679 Broadway: Adapt to GdkWindowImpl API change 2011-11-05 01:12:07 -04:00
Matthias Clasen
6f48f20c67 Quartz: Adapt to GdkWindowImpl api change 2011-11-05 01:11:50 -04:00
Matthias Clasen
32884e9c16 win32: Adapt to GdkWindowImpl api change 2011-11-05 01:11:18 -04:00
Matthias Clasen
250d4331b2 Add device-taking variants of begin_resize/move_drag
This was one of the last places where display->core_pointer was
used in non-deprecated code paths.
2011-11-05 01:10:16 -04:00
Matthias Clasen
3bd0059850 GdkDeviceManager: some reshuffling of docs 2011-11-04 23:38:11 -04:00
Benjamin Otte
b120cb04a5 gdk: Move a bunch of deprecated code to a new file
The new file defines GDK_DISABLE_DEPRECATION_WARNINGS so it can happily
use deprecated APIs.

This commit moves those functions there that use deprecated functions
and currently cause warnings.

With this commit, GDK compiles without deprecation warnings.
2011-11-02 02:32:53 +01:00
Benjamin Otte
c9a648395e display: Don't use deprecated functions
When synthesizing crossing events, actually query the position of the
device we care about instead of using the core pointer every time.
2011-11-02 02:32:53 +01:00
Benjamin Otte
eddacfcc71 x11: Do fallback resize without deprecated functions
After consulting with Carlos, we agreed that it should be enough to grab
the core pointer instead of doing a full grab. If it turns out that's
wrong, we need to adapt the internal API for resizes to take the device
doing the resize.
2011-11-02 02:32:45 +01:00
Benjamin Otte
14d35d5c09 x11: Don't use deprecated function
Use the replacement instead.
2011-11-02 02:32:25 +01:00
Matthias Clasen
d7c264653a Don't use deprecated Pango api 2011-11-01 21:13:35 -04:00
Matthias Clasen
c3d2df4eab GDK: Adapt to GLib thread api changes 2011-11-01 21:11:04 -04:00
Bastien Nocera
1cffe6c2e4 gdk: Translate keyboard brightness keys
https://bugzilla.gnome.org/show_bug.cgi?id=662628
2011-10-26 10:36:43 +01:00
Bastien Nocera
aceccd5819 gdk: Make gen-keyname-table.pl work again
keyname-table.h was modified by hand, and gen-keyname-table.pl
couldn't be used to generate that file again.

https://bugzilla.gnome.org/show_bug.cgi?id=662628
2011-10-26 10:36:43 +01:00
Michael Natterer
077b366879 quartz: don't return FALSE from GdkDevice::query_state()
Not finding a child window to return is not a failure.
2011-10-22 23:21:02 +02:00
Matthias Clasen
34d6caab5e Don't refer to --sync anymore
That commandline option got replaced with an environment variable,
so mention that in the warning text.

https://bugzilla.gnome.org/show_bug.cgi?id=662132
2011-10-20 21:50:01 -04:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Michael Natterer
616afadd78 gdk: s/gdk_cursor_unref/g_object_unref/ 2011-10-15 14:35:28 +02:00
Matthias Clasen
9e0efc5022 Add deprecation annotations for deprecated functions
We define our own GDK_DEPRECATED[_FOR] macros for this
and allow it to be turned off by defining the
GDK_DISABLE_DEPRECATION_WARNINGS macro.
2011-10-11 15:03:46 -04:00
Alex Corrado
defdfde999 Quartz, Bug 655057: Eliminate Compiler Warning
When compiled with older SDKs, the original change for this bug caused a
compiler warning about NSWindow not being able to handle a setStyleMask
message. This tricks the compiler into thinking that it can.
2011-10-09 10:18:40 -07:00
Matthias Clasen
a35d8764da Add G_GNUC_DEPRECATED annotations in GDK 2011-10-09 09:55:08 -04:00
Kristian Rietveld
d172f1ce22 quartz: also update window position on windowDidResize
When a window goes fullscreen, the resize also changes its size.
2011-10-08 11:47:11 +02:00
Michael Natterer
5b74ee38e8 gdk: fix gdk_keyval_to_lower/upper() for Quartz, Win32 and Broadway
In 2.x, the !HAVE_XCONVERTCASE fallback of keyval_convert_case() was
implicitly used as implementation for all !X11 backends.

In 3.x, when this function was virtualized in GdkDisplayManager,
this fallback was moved to the X11 backend and the other backends
"equipped" with /* FIXME implement */ implementations of
keyval_convert_case() which don't convert anything.

Move the fallback code back to gdk/ as default implementation
of GdkDisplayManager::keyval_convert_case() and remove its
implementations is all backends but X11. Also remove the
implementation in Wayland which was a plain copy of what
is now the default implementation.
(cherry picked from commit f46c1b76d8)
2011-10-07 16:19:41 +02:00
Adel Gadllah
25e65dc1b5 gdk: Plug leak in gdk_display_pointer_is_grabbed
gdk_x11_device_manager_core_list_devices returns a new allocated
list, which has to be freed.

valgrind output:

==18686== 160,176 (80,088 direct, 80,088 indirect) bytes in 3,337 blocks are definitely lost in loss record 25,347 of 25,378
==18686==    at 0x4C256DD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18686==    by 0x6CD7752: g_malloc (in /lib64/libglib-2.0.so.0.3000.0)
==18686==    by 0x6CEE2B6: g_slice_alloc (in /lib64/libglib-2.0.so.0.3000.0)
==18686==    by 0x6CCB37D: g_list_prepend (in /lib64/libglib-2.0.so.0.3000.0)
==18686==    by 0x654CADA: gdk_x11_device_manager_core_list_devices (gdkdevicemanager-core-x11.c:836)
==18686==    by 0x6531489: gdk_display_pointer_is_grabbed (gdkdisplay.c:1270)
==18686==    by 0x5162E1E: filter_func (ui.c:140)
==18686==    by 0x6558B50: gdk_event_apply_filters (gdkeventsource.c:83)
==18686==    by 0x6558CB3: _gdk_x11_display_queue_events (gdkeventsource.c:197)
==18686==    by 0x6530680: gdk_display_get_event (gdkdisplay.c:311)
==18686==    by 0x65589F1: gdk_event_source_dispatch (gdkeventsource.c:356)
==18686==    by 0x6CD0A0E: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.3000.0)

https://bugzilla.gnome.org/show_bug.cgi?id=660676
2011-10-03 14:11:43 +02:00
Matthias Clasen
c8eb4e5abe Add new api to gdk.symbols
This keeps 'make check' happy.
And if 'make check' is happy, so am I.
2011-10-02 10:22:13 -04:00
Javier Jardón
522c305c12 gdkcreen-x11: Use GdkRGBA instead GdkColor 2011-10-01 20:45:27 +01:00
Rui Matos
34357481b3 docs: Delete duplicate line in gdkwindow.c 2011-10-01 01:24:36 +01:00
Cosimo Cecchi
036c193fb2 GdkWindow: fix conditional jump depends on uninitialized value error
Those if() blocks don't have any reason being there, as x and y are not
pointers. If the window is destroyed, just set the out values to zero
and return.

As seen in valgrind:

==3306== Conditional jump or move depends on uninitialised value(s)
==3306==    at 0x624C74F: gdk_window_get_root_coords (gdkwindow.c:6933)
==3306==    by 0x5E193C3: gtk_tooltip_show_tooltip (gtktooltip.c:1160)
==3306==    by 0x5E19C05: tooltip_popup_timeout (gtktooltip.c:1282)
==3306==    by 0x623B102: gdk_threads_dispatch (gdk.c:754)
==3306==    by 0x8592F3A: g_timeout_dispatch (gmain.c:3907)
==3306==    by 0x859174C: g_main_context_dispatch (gmain.c:2441)
==3306==    by 0x8591F47: g_main_context_iterate (gmain.c:3089)
==3306==    by 0x8592494: g_main_loop_run (gmain.c:3297)
==3306==    by 0x5D2E501: gtk_main (gtkmain.c:1362)
==3306==    by 0x5C5652F: gtk_application_run_mainloop
(gtkapplication.c:115)
==3306==    by 0x7C47C9D: g_application_run (gapplication.c:1323)
==3306==    by 0x447B5F: main (nautilus-main.c:102)
==3306==  Uninitialised value was created by a stack allocation
==3306==    at 0x624D48A: gdk_window_get_device_position
(gdkwindow.c:4952)
2011-09-28 20:20:19 -04:00
Michael Natterer
0a13deae88 quartz: don't filter away directly encoded 24-bit UCS characters
gdk_unicode_to_keyval(uc) returning (uc | 0x01000000) is not an
error return value but simply the way to encode 24-bit unicode
characters directly as keyvals.
2011-09-28 13:48:52 +02:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
4a7a67339a Bug 659602 - Provide an abstraction for the platform's use of modifier keys
Add enum GdkModifierIntent which identifies use cases for modifier masks
and GdkKeyMap::get_modifier_mask(). Add a default implementation which returns
what is currently hardcoded all over GTK+, and an implementation in the
quartz backend. Also add gtk_widget_get_modifier_mask() which simplifies
things by doing widget->display->keymap->get_modifier_mask().
2011-09-27 09:56:25 +02:00
Michael Natterer
a99d14f61c quartz: resolve the modifier confusion on the Mac
- map Alt/Option to MOD1
- map Command to MOD2
- map MOD2 to the virtual Meta
- improve/fix (?) group handling in gdkkeys-quartz.c
2011-09-26 16:01:50 +02:00
Matthias Clasen
5ff8fe6971 Documentation fixes
Mostly making sure that return values and varargs don't loose
their docs.
2011-09-25 21:04:49 -04:00