Commit Graph

66 Commits

Author SHA1 Message Date
Emmanuele Bassi
45361e19c3 Rename more GSources to use gtk 2019-02-06 10:37:24 +01:00
Ignacio Casal Quinteiro
1729da8a3e quartz: do not cache the screen in the gdkmonitor
Instead we just cache the monitor number and get
out of it the nsscreen when it is needed. This is
a requirement since it nsscreen it is not supposed
to be cached.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1312
2018-10-17 10:10:44 +02:00
Alexander Larsson
890080ebf7 GdkWindow -> GdkSurface: File renames
Rename all *window.[ch] source files.

This is an automatic operation, done by the following commands:

for i in $(git ls-files gdk | grep window); do
    git mv $i $(echo $i | sed s/window/surface/);
    git sed -f g $(basename $i) $(basename $i | sed s/window/surface/) ;
done

git checkout NEWS* po-properties po
2018-03-20 11:46:11 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Emmanuele Bassi
334acbfc39 Replace gdk_threads_add_idle* with g_idle_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_idle() and
gdk_threads_add_idle_full() exist is to allow invoking a callback with
the GDK lock held, in case 3rd party libraries still use the deprecated
gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing idle callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Matthias Clasen
a62e75964c quartz: Make GdkQuartzScreen a plain object
No need to derive this from GdkScreen anymore.
2017-11-17 13:47:15 -05:00
Matthias Clasen
4f701c71f1 quartz: Drop use of gdk_display_get_toplevel_windows
We can use the newly added helper function for this.
2017-11-05 18:28:27 -05:00
Matthias Clasen
3b7763eebc Drop gdk_screen_get_display
This is not longer used.
2017-11-01 20:57:46 -04:00
Matthias Clasen
b44ef37a21 quartz: Stop using gdk_screen_get_display
We can just use the field directly.
2017-11-01 20:54:22 -04:00
Matthias Clasen
727aa6cb08 Drop the monitors-changed signal
We are not using it anymore.
2017-10-31 22:42:33 -04:00
Matthias Clasen
524fcbecfd Drop gdk_screen_get_root_window
This function is no longer used.
2017-10-31 21:28:28 -04:00
Matthias Clasen
8f129ddd13 Use gdk_display_get_toplevel_windows
This replaces the GdkScreen api of the same name.
2017-10-31 20:47:57 -04:00
Matthias Clasen
dea277520f quartz: Don't set the GdkScreen get_setting vfunc
We are not using it anymore.
2017-10-30 16:51:59 -04:00
John Ralls
139b669196 Replace NSScreen:userSpaceScaleFactor, deprecated since MacOS X 10.7.
userSpaceScaleFactor is not compatible with high-resolution (aka HiDPI)
displays.
2017-04-11 16:10:51 -07:00
Tom Schoonjans
98d9a05a0c quartz: code cleanup
removed unused static functions, unused class variables and a large
comment section that was copied over from gdkdisplay-x11.h

https://bugzilla.gnome.org/show_bug.cgi?id=779184
2017-04-01 16:45:37 -04:00
Tom Schoonjans
758d26738a quartz: add support for Gtk+4
The addition of GdkMonitor broke the quartz backend. This patch restores
that support by adding a new class GdkQuartzMonitor, and by modifying
the existing classes GdkQuartzDisplay and GdkQuartzScreen where
necessary.

It should be noted that this patch is essentially a refactor as no new
functionality that will impact the user has been added or removed.

https://bugzilla.gnome.org/show_bug.cgi?id=779184
2017-04-01 16:45:37 -04:00
John Ralls
2b53583e80 Remove screen height and width functions from gdk-quartz.
Since they were previously deleted from gdk.
2016-11-05 15:08:59 -07:00
Benjamin Otte
4585af5719 gdk: Remove visual APIs from GdkScreen
gdk_screen_list_visuals(), gdk_screen_get_system_visual() and
gdk_screen_get_rgba_visual() are gone now.
2016-11-04 00:02:37 +01:00
Benjamin Otte
d249e77bcb API: screen: Remove gdk_screen_is_composited()
Switch code to use gdk_display_is_composited() instead.

The new code also doesn't use a vfunc to query the property but rather
requires the backend to call set_composited()/set_rgba() to change the
value.
2016-10-29 04:49:47 +02:00
Benjamin Otte
45c0379f87 API: gdk: Remove visual querying APIs
They are unused, only work on the default display anyway and visuals are
on their way out.
2016-10-28 05:22:50 +02:00
Alexander Larsson
70935f0952 Drop support for offscreen GdkWindows
These complicate a lot of GdkWindow internals to implement features
that not a lot of apps use, and will be better achieved using gsk.
So, we just drop it all.
2016-10-25 09:54:37 +02:00
Benjamin Otte
8d54c641f1 screen: Remove unused vfunc
GdkScreenClass.broadcast_client_message was unused, but a bunch of
backends still had functions (not) implementing it.
2016-10-16 18:17:21 +02:00
Benjamin Otte
9be9e00a0e API: screen: Remove gdk_screen_make_display_name()
It's identical to gdk_display_get_name().
2016-10-16 18:17:21 +02:00
Benjamin Otte
6b9e481e38 API: screen: Remove gdk_screen_get_active_window()
... and gdk_screen_get_window_stack().

Those functions were originally added in
5afb4f0f11 but do not seem to be used as
they are not implemented anywhere but in X.

As GDK is not meant to fulfill window management functionality I'm going
to remove these functions without replacements.
2016-10-16 18:17:21 +02:00
Benjamin Otte
26f9b584be API: gdk: Remove gdk_screen_get_number()
It's useless everywhere but in internal X11 code.
2016-10-16 18:17:21 +02:00
Marek Kasik
8b5d30d439 Remove redundant checks for NULL
Remove checks for NULL before g_free() and g_clear_object().
Merge check for NULL, freeing of pointer and its setting
to NULL by g_clear_pointer().

https://bugzilla.gnome.org/show_bug.cgi?id=733157
2014-10-02 19:06:03 +02:00
Owen W. Taylor
fc6e2cc4b2 Handle resolution changes in the GDK backend code
gdk_x11_display_set_window_scale() affects the interpretation of the
Xft/DPI XSETTING - it is substituted inside GDK with the value of
Gdk/UnscaledDPI xsetting. However, this change is not propagated to
GTK+ and from GTK+ back to gdk_screen_set_resolution() until the
main loop is run.

Fix this by handling the screen resolution directly in gdk/x11.
This requires duplication of code between GDK and GTK+ since we still
have to handle DPI in GTK+ in the case that GdkSettings:gtk-xft-dpi
is set by the application.

https://bugzilla.gnome.org/show_bug.cgi?id=733076
2014-07-13 15:35:23 -04:00
Bastien Nocera
f71f7215ab all: Name more idles and timeouts
Following up from 438cd857c4,
name more timeouts and idles.

The original grep was missing checking for gdk_threads_add_*()
functions (at least for some of the files).

https://bugzilla.gnome.org/show_bug.cgi?id=726870
2014-03-26 20:09:30 -04:00
Charles Reiss
4cf5ce2e08 Bug 709939 - monitor reconfiguration while GtkOffscreenWindows
exist triggers crash on quartz. Special case the position update
to ignore the off-screen windows.
2013-10-11 15:53:37 -07:00
Michael Natterer
d4607be003 quartz: Implement get_scale_factor() on screen and window 2013-07-03 14:34:13 +02:00
Benjamin Otte
a489f69e00 gdk: Remove unused function 2013-04-15 15:43:27 +02:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Michael Natterer
d95b5308ea quartz: implement GdkScreen::get_monitor_workarea() 2012-02-23 15:34:46 +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
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
Kristian Rietveld
deffbd9885 quartz: reorder gdkprivate-quartz.h and related clean up 2010-12-23 14:17:42 +01:00
Kristian Rietveld
1e2907fa02 quartz: _gdk_quartz_screen -> gdk_quartz_screen 2010-12-23 14:17:42 +01:00
Kristian Rietveld
caa9794af8 quartz: Clean up header files, use same arrangement as X11 backend 2010-12-23 14:17:41 +01:00
Kristian Rietveld
d024153c96 quartz: Fix screen implementation, rename to GdkQuartzScreen 2010-12-22 17:47:02 +01:00
Matthias Clasen
d2ce9ec3dc Convert a bunch of visual related calls to use the screen vtable, quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen
41352f24d6 Convert all GdkScreen methods to vtable calls, quartz backend 2010-12-22 17:46:59 +01:00
Benjamin Otte
cf4cb4f6d9 API: Remove colormap handling from GdkScreen
In particular, the following functions are gone:
- gdk_screen_get_default_colormap()
- gdk_screen_set_default_colormap()
- gdk_screen_get_system_colormap()
- gdk_screen_get_rgba_colormap()
2010-09-26 15:11:34 +02:00
Matthias Clasen
182108c68e Implement gdk_screen_get_primary_monitor in all GDK backends
The implementations are all trivial, just returning 0. At least
for Quartz, we could probably do better than that. Bug 604459.
2009-12-13 20:40:02 -05:00
Kristian Rietveld
cffddd2adc Document how Cocoa coordinate and monitor layout transforms to GDK work 2009-11-15 15:29:45 +01:00
Kristian Rietveld
a338c7e929 Update copyright 2009-10-26 09:57:11 +01:00
Kristian Rietveld
fa8fa48ef1 Update position of toplevels after display reconfiguration
We have to do this, especially after the screen containing the menubar
has changed.  Such more larger changes in monitor geometry will cause
changes to how monitors are laid out in the root window.  The position
coordinates of the windows will have to be updated to reflect their
position in the new layout.
2009-10-26 09:52:54 +01:00
Kristian Rietveld
93530675de Update size of root window after display reconfiguration 2009-10-26 09:52:54 +01:00
Kristian Rietveld
959a9437e6 Support arbitrary screen layouts
The Quartz port now supports arbitrary multiple monitor layouts instead
of only monitors are were laid out horizontally.  This builds on the
reworked coordinate translation done in a previous commit.
2009-10-26 09:52:54 +01:00
Kristian Rietveld
8846012c6d Rework coordinate transformation to be based on root window
The root window contains all the monitors attached to a Mac.  The
coordinate transformation now both translates the x and y coordinate,
translating it from the Cocoa monitor coordinate space to the GDK
coordinate space.  How monitors are laid out in the root window differs
between Cocoa and GDK, which is why it is important to translate based
on the root window to get multi monitor setups to work properly.

We have replaced the old y coordinate transformation function with
new functions that translate both the x and y coordinate.

When creating new toplevels, we have to determine the Cocoa screen on
which the toplevel should appear and translate the coordinates according
to that screen.

This change also fixes event handling in case there is a monitor left
of the screen containing the menu bar.  In such a case all coordinates
on the left monitor are negative.  Event handling broke, because of
_gdk_quartz_window_find_child() checking bounds.  Now that coordinates
are always properly translated to GDK coordinate space, in which negative
coordinates do never occur, the checks here will work properly.
2009-10-26 09:52:54 +01:00
Kristian Rietveld
d26dd103b2 Be consistent with X11: emit monitors-changed first, then size-changed 2009-10-26 09:52:53 +01:00