Commit Graph

1651 Commits

Author SHA1 Message Date
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