Commit Graph

1635 Commits

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