Commit Graph

171 Commits

Author SHA1 Message Date
Matthias Clasen
389ae3e022 settings: Avoid a redundant check
g_value_transform already returns whether it was successful
or not, so no need to call g_value_type_transformable beforehand.
2015-09-09 06:32:45 -04:00
Krzesimir Nowak
39f91d7cdb gdk: Fix a typo 2015-05-22 14:39:53 +02:00
Matthias Clasen
9dad9378f2 Fix primary monitor determination with XRANDR 1.5
This was an oversight in the previous patch.
2015-05-22 06:56:23 -04:00
Dave Airlie
e670720d19 gtk3: add randr 1.5 monitor support
This patch introduces support for using the newly introduced
monitor objects in the XRandR protocol. These objects are meant
to be used to denote a set of rectangles representing a logical
monitor, and are used to hide details like monitor tiling and
virtual gpu outputs.

This uses the new objects instead of crtc/outputs objects when
they are available to create the monitor lists. X server 1.18
is required on the server side for randr 1.5.

https://bugzilla.gnome.org/show_bug.cgi?id=749561
2015-05-21 23:09:04 -04:00
Javier Jardón
710f332082 configure.ac: Depend on cairo 1.14.0
This is needed for cairo_set_device_scale()
2014-11-10 15:12:17 +00:00
Matthias Clasen
46ff5ef6ce x11: Neuter workarea in fullscreen scenarios
If we have a fullscreen window that covers a monitor, desktop
chrome is not relevant for placing of menus and other popups.
Therefore, return the full monitor geometry instead of the
workarea in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=737251
2014-09-24 20:31:11 -04:00
Matthias Clasen
c46b954dd0 Cosmetic formatting fixes 2014-07-10 18:35:54 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
8d6717097c docs: Use markdown for ulinks 2014-02-04 16:58:53 -05:00
William Jon McCann
0a1d276f4f docs: don't use <type> tags
Use # syntax where appropriate.
2014-01-28 00:21:26 -05:00
Rico Tzschichholz
ed5d9b3c3e x11: Add/Fix '(type *)' g-i annotations 2014-01-09 21:47:04 +01:00
Matthias Clasen
f759523a30 Deal with broken _NET_WORKAREA more gracefully
fvwm seems to have problems keeping _NET_WORKAREA in sync with
the number of desktops. Instead of reading garbage, silently use
the full screen as workarea for desktops that are not covered
by the _NET_WORKAREA property.

https://bugzilla.gnome.org/show_bug.cgi?id=698248
2014-01-04 15:15:00 -05:00
Matthias Clasen
c37e3b6316 x11: Avoid a possible memory leak in an error case
If _NET_WORKAREA is set to nonsensical values, we should still
free the memory before returning.
2014-01-04 15:13:51 -05:00
Carlos Garnacho
d1414211bf x11: keep track of the screen pixel size by calculating the bounding box of monitors
This is so we always have the latest information given by XRandR (or other), and not
rely on Core protocol information that might not have been updated yet.

This is specially visible when a monitor is connected (less frequent) or disconnected
(much more frequent), callbacks on GdkScreen::monitors-changed that call
gdk_screen_get_width/height() could get the screen size previous to the monitor
rearrangement.

So in order to fix this, keep track of the latest monitors information, and calculate
the bounding box in order to know the screen size.

https://bugzilla.gnome.org/show_bug.cgi?id=715029
2013-11-25 17:19:46 +01:00
Matthias Clasen
13f6552a7e x11: Add EWMH workspace handling api
Add a few functions that give access to the EWMH workspace
properties.
2013-08-24 00:51:56 -04:00
Alexander Larsson
66f1deef40 Enforce a fixed scale of 1 if no cairo scale support
We used to just follow the default, which would pick up scale
changes from xsettings, but that is not right if we can't
actually support scales.
2013-08-20 10:29:45 +02:00
Alexander Larsson
3a0b65c5b9 x11: send monitors-changed when screen scale changes 2013-08-03 16:53:46 +02:00
Alexander Larsson
9237da2e57 x11: Update root window scale when the screen scale changes 2013-08-03 16:53:46 +02:00
Alexander Larsson
867ba1df27 x11: Don't follow dpi and scale from xsettings when GDK_SCALE set
If things are hardcoded in the environment, that wins.
2013-07-03 14:36:05 +02:00
Alexander Larsson
d89a98e31e x11: Support the Gdk/WindowScalingFactor xsetting
This xsetting can be used to tell Gtk to use a specific window
scaling for the screen.
2013-07-03 14:34:14 +02:00
Alexander Larsson
525e5cff04 x11: Initial cut at supporting window scaling for X11
If you set GDK_SCALE=2 in the environment then all windows will be
scaled by 2. Its not an ideal solution as it doesn't handle
multi-monitors at different scales, and only affects gtk apps.
But it is a good starting points and will help a lot on HiDPI
laptops.
2013-07-03 14:34:14 +02:00
Matthias Clasen
dfa2e91cd7 GdkScreenX11: Dispose visuals
If we let them hold onto their X resources until finalize,
it is too late.
2013-06-29 19:23:23 -04:00
John Lindgren
6eea6ddcc3 Optimize gdk_x11_screen_supports_net_wm_hint()
Move the call to gdk_x11_atom_to_xatom_for_display() outside of the
search loop in gdk_x11_screen_supports_net_wm_hint().  In my test case
(running Audacious for about a minute), this reduced the total number of
hash table lookups performed from 370,000 to 230,000.

https://bugzilla.gnome.org/show_bug.cgi?id=702913
2013-06-23 21:25:26 +02:00
Geoff Reedy
c6eddaafed GdkScreen: get a long X property correctly
https://bugzilla.gnome.org/show_bug.cgi?id=691426
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-26 17:58:21 -06:00
Benjamin Otte
de08716526 x11: Handle case where xsettings are NULL 2013-02-19 19:55:02 +01:00
Benjamin Otte
588513fc9a x11: Get rid of XSettingsClient object
Instead, store its variables in the GdkX11Screen.
2013-02-19 14:33:39 +01:00
Benjamin Otte
13eeb6ca33 x11: Introduce _gdk_x11_get_xatom_for_display_printf()
and use it instead of caching the atom in the GdkScreenX11.
2013-02-19 14:33:39 +01:00
Benjamin Otte
b2043511ee x11: Don't keep an "in_init" variable
Instead, track the init state with a boolean argument.
2013-02-19 14:33:39 +01:00
Benjamin Otte
200d6fe664 x11: Clean up xsettings header
- Don't use defines for renames
- Move enum into only source file using it
2013-02-19 14:33:38 +01:00
Benjamin Otte
e1efe3269c x11: Get rid of XSettingsSetting
Use GValue throughout instead.
2013-02-19 14:33:38 +01:00
Benjamin Otte
ed38dbe28f x11: Consolidate root window event setting in one place
No need to duplicate things in xsettings code.
2013-02-19 14:33:37 +01:00
Benjamin Otte
edf19ab7b4 x11: Store GDK name in xsettings hash table
The X name is only used while reading the property, so no need to keep
it.
2013-02-19 14:33:37 +01:00
Benjamin Otte
a4f11fa4f5 x11: Make xsettings callbacks code go away
It's the same callbacks every time, so just move them into the source
file.
2013-02-19 14:33:37 +01:00
Benjamin Otte
7800e68b73 x11: Call grab functions directly
... instead of going via vfuncs.
2013-02-19 14:32:41 +01:00
Benjamin Otte
eb4792128f x11: Pass the GdkScreen to the XSettingsClient 2013-02-19 14:32:41 +01:00
Benjamin Otte
63f0797e70 x11: Return XSetting without copying 2013-02-19 14:32:41 +01:00
Benjamin Otte
c1a4a1da10 xsettings: Remove unused function
Remove xsettings_client_new() and rename
xsettings_client_new_with_grab_funcs() to xsettings_client_new()
2013-02-19 14:32:40 +01:00
John Lindgren
885b43dd3a Use hash-based conversions for XSETTINGS names.
https://bugzilla.gnome.org/show_bug.cgi?id=692605
2013-01-27 01:08:25 +01:00
Olivier Fourdan
dac6a76ef2 x11: implement gdk_window_apply_fullscreen_mode()
for the X11 backend using the EWMH mechanism
_NET_WM_FULLSCREEN_MONITORS.

https://bugzilla.gnome.org/show_bug.cgi?id=691856
2013-01-25 13:16:57 +01:00
Geoff Reedy
2fcbe3a9b4 x11: add missing checks that a hint is supported
Before acting on any hint that is set by the window manager we must
first check that the hint is supported by the current window manager.
Checking that a property has a value is insufficient as it may have
been set by a previous window manager which did support the hint.

https://bugzilla.gnome.org/show_bug.cgi?id=691515
2013-01-12 18:38:37 -05: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
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Michael Natterer
8c1c4dfd7c gdk: pull more precondition checks into the generic gdkscreen.c 2012-02-24 16:44:44 +01: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
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
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
Matthias Clasen
89c8c1f8a8 Doc format fixes 2011-12-15 23:09:10 -05: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