Commit Graph

25 Commits

Author SHA1 Message Date
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
Kristian Rietveld
e36872da38 Use screen when emitting signal, not _gdk_screen 2009-10-26 09:52:53 +01:00
Kristian Rietveld
63e2f54516 Emit monitors-changed signal when appropriate 2009-10-26 09:52:53 +01:00
Kristian Rietveld
12dc617dc2 Move screen resolution setup to GdkScreenQuartz initializer 2009-10-26 09:52:53 +01:00
Kristian Rietveld
d47772f002 Create a proper subclass of GdkScreen: GdkScreenQuartz 2009-10-26 09:52:52 +01:00
Kristian Rietveld
73b55ae8f5 Register and handle a display reconfiguration callback
Using this we can update our internal monitor/screen layout state
and emit the GdkScreen::size-changed signal.  Work has not
completely finished on this yet, see bug 596238.
2009-10-26 09:52:52 +01:00
Kristian Rietveld
ce3c861c2a Setup monitor rects during screen initialization and re-use data 2009-10-26 09:52:52 +01:00
Kristian Rietveld
ca20b04b58 Move screen initialization to gdkscreen-quartz.c 2009-10-26 09:52:52 +01:00
Kristian Rietveld
2f782de1b7 Bug 596012 - popup menu position is horribly off on gdk quartz with ...
Based on first patches by Christian Hergert.  Change
screen_get_monitor_geometry() so that it translates the layout of the screens
from Cocoa layout to GDK layout.  In Cocoa, the screen locations
are specified in Cocoa geometry, as well as that GDK uses a different way
to place individual monitors in the root window.  For now only monitors
that are laid out horizontally are supported (see the FIXMEs in the source),
in bug 596238 we will track future work to get things fully right.

Modify _gdk_quartz_window_get_inverted_screen_y() to take the differences
in screen layout between Cocoa and GDK into account.  Also this function
is subject to future work.
2009-09-27 13:44:10 +02:00
Richard Hult
e7d1152a8e Implement those, fixes loading python bindings.
2008-08-07  Richard Hult  <richard@imendio.com>

	* gdk/quartz/gdkscreen-quartz.c: (gdk_screen_get_monitor_plug_name)
	(gdk_screen_get_monitor_height_mm, gdk_screen_get_monitor_width_mm):
	Implement those, fixes loading python bindings.

svn path=/trunk/; revision=21029
2008-08-07 08:14:12 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Richard Hult
e8071ea7c9 Set the resolution.
2007-05-21  Richard Hult  <richard@imendio.com>

	* gdk/quartz/gdkdisplay-quartz.c: (gdk_display_open): Set the
	resolution.
	
	* gdk/quartz/gdkscreen-quartz.c: Use the autorelease pool macros.

svn path=/trunk/; revision=17887
2007-05-21 19:40:43 +00:00
Richard Hult
a862e9f6b9 Import AppKit.h instead of Quartz.h. Don't use userSpaceScaleFactor for
2007-02-18  Richard Hult  <richard@imendio.com>

	* gdk/quartz/GdkQuartzView.h:
	* gdk/quartz/GdkQuartzWindow.h:
	* gdk/quartz/gdkquartz.h: Import AppKit.h instead of Quartz.h.
	* gdk/quartz/gdkscreen-quartz.c: (get_mm_from_pixels): Don't use 
	userSpaceScaleFactor for 10.3. Those changes bring us closer to working
	on panther, patch from Mathias Hasselmann.
	
	* gdk/quartz/gdkeventloop-quartz.c: Add includes to fix build warnings.

svn path=/trunk/; revision=17323
2007-02-18 10:26:49 +00:00
Søren Sandmann
b9d1a03440 Create 'composited' label.
Tue Apr 25 10:25:28 2006  Søren Sandmann  <sandmann@redhat.com>

	* tests/testgtk.c (create_alpha_window): Create 'composited' label.

	* tests/testgtk.c (on_composited_changed): New function, change
	the label to say whether the screen is composited or not.

	* gtk/gtkwindow.c (gtk_window_on_composited_changed): When
	composited status change, invalidate the window and propagate the signal;.

	* gtk/gtkwindow.c (gtk_window_map): Set the appropriate type hint
	if reset_type_hint is TRUE.

	* gtk/gtkwindow.c (gtk_window_set_type_hint): If hint is one of
	the old hints, store a shadow copy in the public window->type_hint
	bitfield, otherwise set this field to normal. Set the private
	field to the type hint.

	* gtk/gtkwindow.c (gtk_window_init): Initialize priv->type_hint.

	* gtk/gtkwindow.c (struct _GtkWindowPrivate): New field
	"reset_type_hint" indicating whether the type hint needs to be
	reset. New field type_hint containing a GdkWindowTypeHint.

	* gtk/gtkwidget.c (propagate_composited_changed): New function to
	propagate changes in composited status.
	(gtk_widget_class_init): Add composited_changed signal.

	* gtk/gtkwidget.h (struct _GtkWidgetClass): New signal composited-changed.

	* gtk/gtkwidget.c (gtk_widget_is_composited): New function.

	* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Set transient for.

	* gtk/gtktooltips.c (gtk_tooltips_force_window): Set the type hint

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Compute whether
	the item belongs to a menubar. Set the type_hint appropriately
	depending on the outcome.

	* gtk/gtkmenu.c (gtk_menu_position): Set the default type hint here.

	* gtk/gtkmenu.c (gtk_menu_attach_to_widget): connect to hierarchy
	changed on the attach widget.

	* gtk/gtkmenu.c (attach_widget_hierarchy_changed): New function to
	set the transient_for property for menus.

	* gtk/gtkdnd.c (set_icon_stock_pixbuf): Set the appropriate type hint.

	* gtk/gtkcombo.c (gtk_combo_popup_list): Make the popup window
	transient for the toplevel.

	* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Set
	transient-for, for the popup window.

	* gdk/x11/gdkwindow-x11.c (gdk_window_get_type_hint): Support for
	new window types.

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_type_hint): Add support
	for new window types.

	* gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_process_owner_change):
	New function called whenever the compositing manager comes and goes.

	* gdk/x11/gdkscreen-x11.c (gdk_screen_is_composited): New function.

	* gdk/x11/gdkscreen-x11.c
	(_gdk_x11_screen_request_cm_notification, make_cm_atom,
	check_is_composited): New functions

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
	_gdk_x11_screen_process_owner_change when an
	XFixesSelectionNotifyEvent is received.

	* gdk/x11/gdkdisplay-x11.c (gdk_display_open): Call
	_gdk_x11_screen_request_cm_notification() on all screens.

	* gdk/quartz/gdkscreen-quartz.c (gdk_screen_is_composited): Dummy
	implementation.

	* gdk/gdkscreen.c (gdk_screen_class_init): New signal,
	'composited-changed'.

	* gdk/gdkwindow.h: Add new EWMH window types.

	* gdk/win32/gdkscreen-win32.c (gdk_screen_is_composited)
2006-04-25 14:27:32 +00:00
Michael Natterer
5afb4f0f11 gdk/gdkscreen.h gdk/x11/gdkscreen-x11.c added
2006-03-08  Michael Natterer  <mitch@imendio.com>

	* gdk/gdkscreen.h
	* gdk/x11/gdkscreen-x11.c
	* gdk/gdk.symbols: added gdk_screen_get_active_window() and
	gdk_screen_get_window_stack() (patch from maemo-gtk).
	Fixes bug #320881.

	* gdk/directfb/gdkscreen-directfb.c
	* gdk/quartz/gdkscreen-quartz.c
	* gdk/win32/gdkscreen-win32.c: added the functions as stubs.
2006-03-08 17:02:34 +00:00
Anders Carlsson
4b705d23d2 Implement these functions. (#327228, Thomas Broyer).
2006-01-18  Anders Carlsson  <andersca@imendio.com>

        * gdk/quartz/gdkevents-quartz.c:
        (get_mm_from_pixels):
        (gdk_screen_get_width_mm):
        (gdk_screen_get_height_mm):
        Implement these functions.
        (#327228, Thomas Broyer).
2006-01-18 10:06:00 +00:00
Anders Carlsson
1097260aa7 Add quartz backend.
2005-11-21  Anders Carlsson  <andersca@imendio.com>

        * configure.in:
        * gtk/Makefile.am:
        * gdk/Makefile.am:
	* gdk/quartz/*:
	Add quartz backend.

        * docs/tools/Makefile.am:
	Only build docshooter when the X11 backend is used.

        * gtk/gtkplug-stub.c:
	Include gtkplug.h here.

        * gtk/gtksocket-stub.c:
	Include gtksocket.h here.
2005-11-22 10:03:32 +00:00