Commit Graph

1708 Commits

Author SHA1 Message Date
Carlos Garnacho
5b014bfdfb gdk: Keep track of the last slave device used
This last slave device (stored per master) is used to fill
in the missing slave device in synthesized crossing events
that are not directly caused by a device event (ie due to
configure events or grabs).
2012-02-23 16:45:29 -05:00
Michael Natterer
f4b15a58db x11: s/_/-/ in signal name "window-manager-changed" 2012-02-21 17:32:37 +01:00
Michael Natterer
427b88f541 GdkScreen: fix precondition checks in the public API
Move g_return_if_fail() stuff from the backends to the public
functions in gdkscreen.c itself, and some fixes for ugly formatting in
the various gdkscreen-backend.c files.
2012-02-21 17:19:35 +01:00
Matthias Clasen
b131de1293 Remove an unnecessary include 2012-02-21 01:50:19 +01:00
Matthias Clasen
9a92a1da89 Add a way to get the current modifier state
Xkb makes this available to us, and it is useful if you want
to do easter eggs that are triggered by Alt.
2012-02-21 01:50:18 +01:00
Bastien Nocera
6697d5c6de x11: Fix first call to _gdk_x11_keymap_key_is_modifier()
_gdk_x11_keymap_key_is_modifier() never tries to set min/max_keycode
if they haven't been set before, meaning that until another function
sets those, all the keys will be seen as non-modifiers.

This causes GdkKeyEvents to be wrongly tagged with "->is_modifier = 0"
when in actual fact the key is a modifier. This fixes keyboard
shortcuts captured with GtkCellRendererAccel in "raw" mode thinking
a modifier without any actual keys is a valid shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=670400
2012-02-19 17:18:13 +01:00
Rui Matos
db2eb85e4a x11: Cancel _NET_WM_MOVERESIZE if we get a matching ButtonRelease
This implements the following part of the EWMH spec:

"The special value _NET_WM_MOVERESIZE_CANCEL also allows clients to cancel the
operation by sending such message if they detect the release themselves
(clients should send it if they get the button release after sending the move
resize message, indicating that the WM did not get a grab in time to get the
release)."

In particular, it fixes the case of clicking widgets that use
gdk_window_begin_[resize|move]_drag*() and the click "sticking", i.e. the
mouse button getting released but the resize or move operation remaining in
effect.

https://bugzilla.gnome.org/show_bug.cgi?id=669208
2012-02-09 23:44:09 +01:00
Matthias Clasen
585a6652d5 Use G_SOURCE_CONTINUE/REMOVE
Now that GLib provides these macros, we should use them
to make the code more readable.
2012-01-30 19:12:27 -05:00
Alexandre Rostovtsev
e2053a582a Add Since: to gdk_x11_device_get_id(), gdk_x11_device_manager_lookup(), gdk_x11_window_set_utf8_property() docs
https://bugzilla.gnome.org/show_bug.cgi?id=667730
2012-01-16 18:08:16 -05:00
Rui Matos
f0a80fa308 x11: Fix the _NET_SUPPORTING_WM_CHECK window fetch to be spec compliant
"The child window MUST also have the _NET_SUPPORTING_WM_CHECK property set to
the ID of the child window. […] If the _NET_SUPPORTING_WM_CHECK window on the
client window is missing or not properly set, clients SHOULD assume that no
conforming Window Manager is present."

This commit implements that, which allows us to not have to do a
XGetWindowProperty() every N seconds when running under a compliant WM.

This is also a more correct fix for the bug handled in commit
daf29bffed.

https://bugzilla.gnome.org/show_bug.cgi?id=666921
2012-01-16 15:38:33 +00:00
Patrick Welche
2ceb092afc Non-XInput2 build fix
The part in gdkwindow-x11.c which uses XIEvent and friends is "protected"
by HAVE_XGENERICEVENTS, i.e., XGetEventData() has been found. (Xlib.h)

XIEvent and friends are defined in <X11/extension/XInput2.h> which is
included by gdkdisplay-x11.h if XINPUT_2 is defined.

The patch makes sure XIEvent is only used if XINPUT_2 is defined.

https://bugzilla.gnome.org/show_bug.cgi?id=667534
2012-01-10 13:54:22 +00:00
Javier Jardón
24360a8076 gdk/*: Use g_list_free_full convenience function 2012-01-05 04:22:42 +01:00
Matthias Clasen
266866e82c Fix problems with DND on some X servers
When the X server does not support the shape extension (as some
vnc implementations seem to), our DND code was always seeing
an empty input shape, so drops always missed their target.

http://bugzilla.gnome.org/show_bug.cgi?id=620240
2012-01-03 10:57:53 -05:00
Matthias Clasen
01320e5773 Fix problems with sticky handling
Reading a card32 property into a long may lead to undefined high
bits, so mask them off. Also, make the conditions for setting and
unsetting the stick flag opposites, to avoid unintended changes.
Patch by John Lindgren, bug 666842
2011-12-28 11:20:47 -05:00
Matthias Clasen
19b47b931e Update various EWMH interactions
The current EWMH has added 'source indication' fields to a number
of client messages. Set these to 1 to indicate a regular client.
Also fill the button field of _NET_WM_MOVERESIZE.
2011-12-28 11:16:54 -05:00
Benjamin Otte
a61ba41167 x11: Don't handle focus events for NULL windows
The check was accidentally removed in the refactoring of
2ea328dfbc.
2011-12-23 00:15:59 +01:00
Matthias Clasen
18406b7b04 Revert "x11: Avoid spurious focus events on grabs"
This reverts commit db4a6040af.

This is causing bad focus confusion e.g. in gnome-terminal.
2011-12-22 16:03:56 +00:00
Ryan Lortie
ecfdb834c9 GtkSettings: add shell-shows-menubar property
Unity will set this to tell us that it is going to handle displaying the
menubar.
2011-12-19 12:51:09 -05:00
Colin Walters
a003eef9d4 gdk: Fix prototype for gdk_x11_window_set_utf8_property 2011-12-19 12:51:08 -05:00
Ryan Lortie
f826dd5481 GtkSettings: add shell-shows-app-menu property
This is a boolean property that will be set to TRUE if the current
desktop environment is capable of displaying the application menu as
part of the desktop shell.

If it is FALSE then the application will need to display the menu for
itself.
2011-12-19 12:51:08 -05:00
Colin Walters
ff38dda9a8 x11: Add gdk_x11_window_set_utf8_property
A convenience function to manipulate UTF-8 X11 properties; no point
in wrapping each one in individual setters.
2011-12-19 12:51:07 -05:00
Benjamin Otte
db4a6040af 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.

https://bugzilla.gnome.org/show_bug.cgi?id=657578
2011-12-19 16:17:14 +01:00
Benjamin Otte
2ea328dfbc x11: Unify focus handling code
This code was essentially copy-pasted in two locations, so unify them in
the same place.

https://bugzilla.gnome.org/show_bug.cgi?id=657578
2011-12-19 16:17:13 +01:00
Matthias Clasen
c6df2828b7 Add gdk_screen_get_monitor_workarea
The function returns the part of a monitors area that should be
used for positioning popups, menus, etc. The only non-trivial
implementation atm is in the X backend, all the other backends
just return the full monitor area. The X implementation is
currently suboptimal, since it requires roundtrips to collect
the necessary information. It should be changed to monitor
the properties for changes, when XFixes allows to monitor
individual properties.
https://bugzilla.gnome.org/show_bug.cgi?id=641999
2011-12-18 14:29:16 -05:00
Carlos Garnacho
358ecad501 gdk,xi2: Make more resilient about not yet known devices
Dealing with disabled devices may turn into hierarchy/device
changed events on device IDs with no backing GdkDevice yet,
so protect against that. The device attachment will be handled
correctly when the device is enabled later.
2011-12-18 18:57:57 +01:00
Matthias Clasen
89c8c1f8a8 Doc format fixes 2011-12-15 23:09:10 -05:00
Florian Müllner
4f8f8fe828 window: Add hide-titlebar-when-maximized property
For maximized windows, titlebars cannot be used to reposition or
scale the window, so if an application does not use it to convey
useful information (other than the application name), the screen
space occupied by titlebars could be put to better use.
Add a new window property which requests from the window manager
to hide titlebars when windows are maximized to account for this.

https://bugzilla.gnome.org/show_bug.cgi?id=665616
2011-12-15 16:31:56 +01:00
Matthias Clasen
89c90ed193 Fix move-resize emulation with XI2
https://bugzilla.gnome.org/show_bug.cgi?id=650943
2011-12-09 21:28:12 -05:00
Matthias Clasen
9b967ab8af XI2: Push error traps around XIQueryDevice calls
This may help against the crashes at resume time that some
people have been hitting when input devices mysteriously
disappear.
2011-11-30 00:16:43 -05:00
Michael Natterer
6bb495f6bd gdk: remove the GET_EFFECTIVE_KEYMAP() stuff from gdkkeys-x11.c
We don't support passing a NULL keymap any longer. Also pull some
precondition checks into the parent class.
2011-11-18 16:43:41 +01:00
Michael Natterer
90e73dd1c4 gdk_x11_keymap_get_modifier_mask(): always return a value 2011-11-18 15:26:09 +01:00
Michael Natterer
9c79f9f868 Turn the private #define for the group-shifting modifier into API
Add GDK_MODIFIER_INTENT_SHIFT_GROUP to enum GdkModifierIntent
and handle it in gdk_keymap_get_modifier_mask(). Add an X11
impl of the method and return keymap_x11->group_switch_mask.
Return 0 from the default impl because we don't know.
2011-11-18 15:14:31 +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
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
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
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
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
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
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
Javier Jardón
522c305c12 gdkcreen-x11: Use GdkRGBA instead GdkColor 2011-10-01 20:45:27 +01:00
Richard Hughes
14df59d47c Fix a segfault if the GAppInfo does not have an icon
This fixes the following backtrace:

 0  g_logv (log_domain=0x7ffff60461a4 "GLib-GObject", log_level=<optimized out>,
    format=0x7ffff599c322 "%s: assertion `%s' failed", args1=0x7fffffffc418) at gmessages.c:577
 1  0x00007ffff59312d2 in g_log (log_domain=<optimized out>, log_level=<optimized out>,
    format=<optimized out>) at gmessages.c:591
 2  0x00007ffff601c3c7 in g_object_ref (_object=0x0) at gobject.c:2648
 3  0x00007ffff7721e22 in gdk_x11_app_launch_context_get_startup_notify_id (context=<optimized out>,
    info=0x7fffe8004b40, files=<optimized out>) at gdkapplaunchcontext-x11.c:331
 4  0x00007ffff62e60d0 in _g_desktop_app_info_launch_uris_internal (appinfo=0x7fffe8004b40, uris=0x0,
    launch_context=0x7fffe401c800, spawn_flags=G_SPAWN_SEARCH_PATH, user_setup=0, user_setup_data=0x0,
    pid_callback=0, pid_callback_data=0x0, error=0x7fffffffc848) at gdesktopappinfo.c:1269
 5  0x00007ffff62e630a in g_desktop_app_info_launch_uris (appinfo=<optimized out>, uris=<optimized out>,
    launch_context=<optimized out>, error=<optimized out>) at gdesktopappinfo.c:1341
 6  0x00007ffff62e636b in g_desktop_app_info_launch (appinfo=0x7fffe8004b40, files=<optimized out>,
    launch_context=0x7fffe401c800, error=0x7fffffffc848) at gdesktopappinfo.c:1388
2011-09-13 16:41:38 +01:00
Carlos Garnacho
79ff1b669c x11: Don't create GdkDevices for disabled devices
Fixes bug #658379 - Disabled devices still added to list on startup,
spotted by Bastien Nocera. Do not create GdkDevices for disabled
devices on device manager construction, leading to a confusing initial
state.
2011-09-06 20:04:08 +02:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Pavel Holejsovsky
21a5b038a7 Add annotations so that methods are properly paired to objects.
Add type annotations to 1st argument of gdk_x11_* functions so that they are
properly recognized as methods of GdkX11 objects.

https://bugzilla.gnome.org/show_bug.cgi?id=655496
2011-08-01 11:09:49 +02:00
Pavel Holejsovsky
0893a3fd39 Enable introspection of X11-specific functions and methods
Functions dealing with native Xlib types were (skip)ed because
gobject-introspection did not have correct Xlib types declarations.
They are corrected now, so these GdkX11 functions can be enabled back
again.

https://bugzilla.gnome.org/show_bug.cgi?id=655495
2011-08-01 11:09:39 +02:00
Patrick Welche
0388781e8f XK_Num_Lock is called GDK_KEY_Num_Lock in this source tree. 2011-07-22 19:19:33 +01:00
Carlos Garnacho
b5f30143ed x11: Skip GenericEvents with no cookie data in the xi2 device manager
https://bugzilla.gnome.org/show_bug.cgi?id=653947

It could happen that a cookie event has been already allocated/freed
in an event filter, as it can't be allocated a second time, all GDK
can do is skipping the event. Spotted by Guillaume Desmottes.
2011-07-15 18:33:44 +02:00
Carlos Garnacho
6aab48ead0 gdk/x11: Add gdk_x11_device_manager_lookup()
This function can be used to find the GdkDevice wrapping
an XInput2 device ID. For core devices, the Virtual Core
Pointer/Keyboard IDs (2/3) may be used.
2011-07-15 18:14:38 +02:00
Carlos Garnacho
f90c154472 gdk/x11: Add gdk_x11_device_get_id()
This function can be used to find out the XInput2 device ID
behind a GdkDevice, mostly useful when you need to interact
with say Clutter, or raw libXi calls.
2011-07-15 18:14:38 +02:00
Javier Jardón
32e00d1f43 Use AM_CPPFLAGS instead the obsolete INCLUDES 2011-07-06 15:58:32 +01:00
Matthias Clasen
c22fb1684c GdkKeymap: Prevent an infinite loop in the non-XKB case
Somehow the increment got lost, as comparison with the 2.x code
shows.
2011-06-30 14:45:16 -04:00
Matthias Clasen
0c162851ed Add a missing break statement 2011-06-14 21:59:55 -04:00
Matthias Clasen
5254fbacfb Avoid an oob read 2011-06-14 21:56:50 -04:00
Carlos Garnacho
d3274e8e06 xi2: Handle XIM modules that replace events
Fixes Bug 645993 - XIM has wierd behaviors. Some XIM modules
filter every key event, possibly replacing it with their own
one. These events usually have serial=0, so make
GdkDeviceManagerXI2 also listen on these.
2011-06-13 07:16:16 -04:00
Javier Jardón
7c688cb8a6 gdk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Carlos Garnacho
e89d6b8741 configure: Check for XGetEventData()
This is a call only available in recent libX11, only the XI2 code
depends on this within GDK, but XI2 implies having GenericEvents
available too.
2011-05-27 11:53:26 +02:00
Carlos Garnacho
3285605c54 gdk: do not fallback to event->xany.window in GdkEventTranslator
This is already done in gdk_event_source_get_filter_window(), and
could lead to wrong event assignment if an event translator happens
to return a window for an event it doesn't handle.
2011-05-27 11:53:04 +02:00
Carlos Garnacho
a529568f79 gdk: Get the right filter window for XI2 events
GdkDeviceManagerXI2 now implements GdkEventTranslator::get_window,
retrieving the right window from the contained XIEvent.
2011-05-18 22:34:33 +02:00
Carlos Garnacho
55cc9f3339 gdk: Add _gdk_x11_event_translator_get_window()
This method can be implemented by event translators so they
return the right window from XGenericEventCookie events, as
ev->xany.window isn't meaningful for these.

GdkEventSource now also uses this to find out the right window
filters to apply.
2011-05-18 22:34:33 +02:00
Carlos Garnacho
53d77a829a gdk: Move XGetEventData() call to GdkEventSource
This function should be called just once across every possible
event translator and GdkFilterFunc that wants to deal with
any cookie event.
2011-05-18 22:34:32 +02:00
Matthias Clasen
5b9e402cf3 Fix a typo in !HAVE_XCURSOR code paths
Patch by Victor Oliveira,
http://bugzilla.gnome.org/show_bug.cgi?id=649665
2011-05-07 12:01:04 -04:00
Javier Jardón
1fcfa91ee3 gdk/x11/gdkcursor-x11.c: Use GdkRGBA instead GdkColor 2011-05-04 17:58:17 +01:00
Dan Winship
91b5223001 GdkDeviceManagerXI2: don't set user_time on ButtonRelease
The XI2 device manager was mistakenly setting the window user_time on
both ButtonPress and ButtonRelease, which meant that processes that
tried to launch another process based on the time of a ButtonPress
event would end up always focus-stealing-preventing the new app.

https://bugzilla.gnome.org/show_bug.cgi?id=647275
2011-04-12 12:53:47 -04:00
Matthias Clasen
611a67b350 GdkWindowImplX11: Struct packing improvements 2011-04-12 12:14:07 -04:00
Matthias Clasen
1c4cb29475 GdkX11Screen: Struct packing improvements 2011-04-12 12:13:56 -04:00
Matthias Clasen
879202b9c2 GdkX11DragContext: Struct packing improvements 2011-04-12 12:13:55 -04:00
Matthias Clasen
cef996d57e GdkX11DeviceXI: Struct packing improvements 2011-04-12 12:13:55 -04:00
Matthias Clasen
fbf1093d5c Free the translate queue when closing a display
Not that many people are ever going to hit this.
https://bugzilla.gnome.org/show_bug.cgi?id=645236
2011-04-08 21:34:25 -04:00
Matthias Clasen
9e6d3d969c Fix some possible crashes if the default display is NULL
Unlikely that many people will hit these, but still.
https://bugzilla.gnome.org/show_bug.cgi?id=645176
2011-04-08 21:20:26 -04:00
Carlos Garnacho
db74a6e816 GdkDevice: Remove duplicate private function
_gdk_device_get_axis_use() dates back to pre-sealing, when the
xi2 work began, this remaining can be gone with a public
gdk_device_get_axis_use() function already in place.
2011-04-08 16:39:45 +02:00
Matthias Clasen
d46f0db38b Make gdk_x11_window_set_theme_variant do nothing for non-toplevels
This avoids problems when calling this e.g. on offscreen windows.
2011-04-03 17:40:37 -04:00
Matthias Clasen
2226996b80 Keymap: properly initialize lock state
We need to get explicitly lock state initially, before we can
rely on state changed events to track it.
https://bugzilla.gnome.org/show_bug.cgi?id=645341
2011-04-03 17:39:31 -04:00
Matthias Clasen
31c036b9b4 Call _exit instead of exit from X error handlers
This is because running atexit() handlers from there is
usually bad news.
https://bugzilla.gnome.org/show_bug.cgi?id=646338
2011-03-31 19:59:00 -04:00
Florian Müllner
3032fdce2a window: Export theme variant to X11
The metacity theme format allows to use colors from the current
GTK+ theme in window decorations. Since GTK+ now gained support
for dark theme variants, window managers using that theme format
(metacity, mutter, compiz via gtk-window-decorator) should be able
to use colors from the correct variant; so in case a variant is
requested, export it in the _GTK_THEME_VARIANT property on
toplevel windows.

https://bugzilla.gnome.org/show_bug.cgi?id=645354
2011-03-21 15:06:34 +01:00
Dan Winship
605c383c78 GdkDeviceManagerXI2: process send_event core events
XSendEvent doesn't currently work with XI2 events, so add code to
translate core events when they have the send_event flag.

(We still don't actually select for core pointer/keyboard events, so
we will only receive send_event events that are sent with a 0
event_mask.)

https://bugzilla.gnome.org/show_bug.cgi?id=644847
2011-03-17 17:18:33 -04:00
Benjamin Otte
8d1b7362b3 x11: Copy from actual window, not parent
This code is a relic from GTK2 days and should not be necessary anymore,
as code now makes sure to only copy those parts of the window that are
not overlapped by parent windows.

By deleting it we fix potential issues with composited and translucent
windows copying the wrong data.

https://bugzilla.gnome.org/show_bug.cgi?id=643416
2011-03-07 17:45:08 +01:00
Carlos Garcia Campos
7aeb3c725b xi2: Ignore button release events of button 4-7
We treat button presses of button 4-7 as scroll wheel events, so release
events should be ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=643925
2011-03-06 12:42:02 +01:00
Michael Natterer
8ee9e132e1 gdk: gdk_x11_device_xi2_get_state(): move stuff to local scope 2011-02-27 15:06:41 +01:00
Matthias Clasen
7df2ce8eab Drop _gdk_x11_set_input_focus_safe
All that this function did was to asynchronously catch errors.
Since we have asynchronous error traps now, we can just use
XSetInputFocus().
2011-02-26 22:16:01 -05:00
Alexander Larsson
0b0f110152 Avoid spurious emissions of monitors-changed
The monitor change detection code in _gdk_x11_screen_size_changed() and
process_monitors_change() goes to some length to make sure its only emitted
when there is an actual change to the data visible via the GdkScreen monitors
api.

However, commit 662e69ad added some code that always emits "monitors-changed"
in _gdk_x11_screen_size_changed when we have randr13 and get a ConfigureNotify
on the root window (even though we may already have emitted it in the
RRScreenChangesNotify event!).

As far as I can tell this is due to a comment in the bug referenced by the
commit (https://bugzilla.gnome.org/show_bug.cgi?id=601712#c4) where it says:

  This version of the patch changes GdkDisplay to emit "monitors-changed" when
  the primary monitor changes (see the change in _gdk_x11_screen_size_changed).

And, if you remove this part of the change the signal is not emitted when just
the primary is changed. However, this is not really the right approach. We
should just also check for if the primary changes in process_monitors_change()
to avoid spurious signal emissions.

https://bugzilla.gnome.org/show_bug.cgi?id=643216
2011-02-24 19:47:02 +01:00
Marc-André Lureau
f598f75dfb gdk_cursor_new_from_pixmap: Fix gdk_display_is_closed call
This was typoed in commit dfe6ba932c
https://bugzilla.gnome.org/show_bug.cgi?id=642843
2011-02-20 20:11:13 -05:00
Martin Nordholts
a3f52949c4 Bug 633291 - Handle Shift-keys in X11 gdk_test_simulate_key()
If a level 1 key maps to a key value passed to
gdk_test_simulate_key(), raise the GDK_SHIFT_MASK flag so the reqested
key value is generated. Also add a regression test for this fix.
2011-02-13 12:57:01 +01:00
Matthias Clasen
728a45fc1f Remove confusion over XI2 defines
Some places were using XINPUT_2, others XINPUT_XI2. Since configure
defines XINPUT_2, use that throughout.
2011-02-11 23:30:01 -05:00
Benjamin Otte
de9a082ddb x11: Make headers identical no matter if we run with or without XI2
Previously we weren't installing the device headers when compiling
without XINPUT support. But we would include them from gdkx.h, so
essentially the build was broken.

With this patch the types will exist but not do anything.
2011-02-12 01:27:40 +01:00
Benjamin Otte
30abd4d8b5 x11: Fix struct definition for GdkDeviceManagaerXI2 2011-02-12 00:16:03 +01:00
Benjamin Otte
e9ff457a40 x11: Make the device manager struct actually subclass the correct device 2011-02-11 23:53:14 +01:00
Benjamin Otte
b1f2e5bfa3 x11: Fix build without Xinput
Missing ifdefs
2011-02-11 23:21:11 +01:00
Matthias Clasen
eaba2cd468 XI2: translate group state back into core state
This is necessary to make the key event translation work
as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=641367
2011-02-04 21:11:40 -05:00
Matthias Clasen
d4c1dbe3d7 Pass group state to _gdk_x11_device_xi2_translate_state
This will be necessary to make groups work with XI2.
2011-02-04 21:11:40 -05:00
Matthias Clasen
2c352f51a0 Share code to fill GdkEventKey.string
This code was duplicated between the core and XI2 device manager
implementations.
2011-02-04 21:11:40 -05:00
Matthias Clasen
9ba009a8eb Remove debug spew 2011-02-04 14:05:22 -05:00
Matthias Clasen
272aa7bc55 XI2: don't translate button releases as scroll events
This fixes scroll-by-2 sympoms seen in combo boxes.
https://bugzilla.gnome.org/show_bug.cgi?id=639846
2011-02-04 12:54:44 -05:00
Benjamin Otte
7b5ad65e71 x11: Use Window isntead of GdkNativeWindow 2011-02-01 18:51:57 +01:00
Benjamin Otte
44c02fcbb1 API: gdk: Change get_drag_window() API
The previous function gdk_drag_get_protocol_for_display() took native
window handles, so it had to be changed. Because it didn't do what it
was named to do (it didn't return a protocol even though it was named
get_protocol) and because it doesn't operate on the display anymore but
on the actual window, it's now called gdk_window_get_drag_protocol().
2011-02-01 18:51:57 +01:00
Benjamin Otte
5bc04bc07b API: gdk: Make GdkEventSelection.requestor a GdkWindow
instead of a GdkNativeWindow. Also change gdk_selection_notify() API to
take a GdkWindow to match this change.
2011-02-01 18:51:57 +01:00
Benjamin Otte
c2a5d715d5 x11: Use gdk_x11_window_foreign_new_for_display() unconditionally
gdk_x11_window_lookup_window() calls are done by this function alreayd,
so no need to do them manually.
2011-02-01 18:51:57 +01:00
Matthias Clasen
5441ecd350 Fix a warning 2011-02-01 09:48:32 -05:00