The monitor change detection code in _gdk_x11_screen_size_changed() and
process_monitors_change() goes to some length to make sure its only emitted
when there is an actual change to the data visible via the GdkScreen monitors
api.
However, commit 662e69ad added some code that always emits "monitors-changed"
in _gdk_x11_screen_size_changed when we have randr13 and get a ConfigureNotify
on the root window (even though we may already have emitted it in the
RRScreenChangesNotify event!).
As far as I can tell this is due to a comment in the bug referenced by the
commit (https://bugzilla.gnome.org/show_bug.cgi?id=601712#c4) where it says:
This version of the patch changes GdkDisplay to emit "monitors-changed" when
the primary monitor changes (see the change in _gdk_x11_screen_size_changed).
And, if you remove this part of the change the signal is not emitted when just
the primary is changed. However, this is not really the right approach. We
should just also check for if the primary changes in process_monitors_change()
to avoid spurious signal emissions.
https://bugzilla.gnome.org/show_bug.cgi?id=643216
(cherry picked from commit 0b0f110152)
Conflicts:
gdk/x11/gdkscreen-x11.c
It doesn't make sense to determine an index into an array, if
you are going to sort the array afterwards...pointed out in
bug 615128 by Florian Scandella.
Currently gdk_screen_get_primary_monitor just returns the first monitor,
in this case but both the panel and now gnome-shell use an additional
heuristic to prefer LVDS as primary if present.
Move this heuristic to gdk_screen_get_primary_monitor to avoid duplicating
it all over the place.
The fallback heuristic is also used when no primary output is set.
https://bugzilla.gnome.org/show_bug.cgi?id=614894
The Gdk-custom.c file in gir-repository contained a number of
introspection annotations. Merge those into the GDK source files.
Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
https://bugzilla.gnome.org/show_bug.cgi?id=592279
When RandR 1.2 X driver doesn't return any usable multihead data the
monitors array is freed, without freeing the memory allocated by the array
elements before. Fixes bug #578354
* gdk/x11/gdkevents-x11.c:
* gdk/x11/gdkscreen-x11.[hc]: Another attempt at getting Xrandr
screen size changes right. Actually handle XRRScreenChangeNotify
events, and ignore root ConfigureNotify events if we are using
Xrandr. Only emit size-changed signals if the screen size changed,
and only emit monitor-changed signals if the monitors changed.
svn path=/trunk/; revision=22398
2009-02-19 Ray Strode <rstrode@redhat.com>
* gdk/x11/gdkscreen-x11.c
(monitor_compare_function), (init_randr13):
After using randr to get a list of monitors,
sort the list such that the biggest output
of "cloned" outputs comes first in the list.
This helps apps that don't generally handle
overlapping outputs to work better in randr
clone mode.
svn path=/trunk/; revision=22386
* configure.in: Check for Xrandr 1.3
* gdk/x11/gdkdisplay-x11.[ch]: Rename have_randr12 to have_randr13
and set if if we have randr 1.3
* gdk/x11/gdkscreen-x11.c: Go back to using randr for monitor
information, if we have XRRGetScreenResourcesCurrent.
svn path=/trunk/; revision=22327
Wed Sep 10 06:18:25 2008 Søren Sandmann <sandmann@redhat.com>
* gdk/x11/gdkscreen-x11.c (init_multihead): Don't use
XRRGetScreenResources() as there are performance issues with
it. Instead rely on the fact that the RandR information is
propagated through Xinerama as well.
svn path=/trunk/; revision=21334
+
+ * gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_size_changed): Emit the
+ monitors changed signal when the screen size changes.
+
svn path=/trunk/; revision=21172
2008-07-22 Frederic Crozat <fcrozat@mandriva.com>
* gdk/x11/gdkscreen-x11.c: Don't use RandR 1.2
if driver is detected as randr12_compat (ie X driver
is not RandR 1.2 compliant). Fixes multihead with
such drivers. Bug #543317.
svn path=/trunk/; revision=20893
2007-12-27 Christian Persch <chpe@gnome.org>
* gdk/x11/gdkscreen-x11.c: (init_randr12): Fir the patch from
bug #504886 not to read unitialised memory.
svn path=/trunk/; revision=19247
Thu Dec 13 13:14:50 2007 Søren Sandmann <sandmann@redhat.com>
* Add RandR 1.2 support
- New monitors_changed signal - New API to get width/height of
monitors, and the name of the plug
svn path=/trunk/; revision=19173
2007-04-30 Tor Lillqvist <tml@novell.com>
Add functionality to set overall opacity of a top-level
window. (#405316)
* gdk/gdk.symbols: Add gdk_window_set_opacity.
* gdk/x11/gdkwindow-x11.c
* gdk/win32/gdkwindow-win32.c: Implement
gdk_window_set_opacity(). On X11 use the _NET_WM_WINDOW_OPACITY
property. On Win32 use SetLayeredWindowAttributes(LWA_ALPHA).
* gdk/gdkwindow.h: Declare gdk_window_set_opacity().
* gdk/x11/gdkscreen-x11.c (gdk_screen_get_rgba_colormap): Document
that this is not implemented in the Windows backend. Add reference
to gdk_window_set_opacity().
svn path=/trunk/; revision=17730
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)
2005-11-10 Michael Natterer <mitch@imendio.com>
Applied patch from maemo-gtk that addresses many issues wrt
display migration and display closing (bug #85715).
* gdk/gdkdisplay.c (gdk_display_dispose): don't just set the
default display to NULL when it's closed. Instead set the most
recently opened display as new default (if one exists).
* gdk/gdkpango.c (on_renderer_display_closed): fixed signature
of this callback.
* gdk/gdkscreen.c (gdk_screen_dispose): check if the GCs still
exist before unrefing them.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): if the screen
is closed, allow destruction of the root window.
* gdk/x11/gdkdisplay-x11.c: moved some stuff from finalize() to
dispose(), free stuff that was leaked before.
* gdk/x11/gdkevents-x11.c (_gdk_x11_events_uninit_screen): check if
the xsettings_client still exists before destroying it.
* gdk/x11/gdkkeys-x11.c: added finalization and free the allocated
X resources.
* gdk/x11/gdkpixmap-x11.c: moved stuff from finalize() to new
dispose() implementation.
* gdk/x11/gdkscreen-x11.c: moved stuff from finalize() to
dispose() and check if it still exists before unrefing it. Set
their pointers to NULL/None *after* upchaining in dispose(),
because X11 implementations of members of the parent class still
need them for their own destruction.
* gdk/x11/gdkvisual-x11.c: removed finalize() implementation which
was g_error()ing when finalizing a visual.
* gtk/gtkclipboard.c (gtk_clipboard_finalize): don't use
get_clipboard_widget() because it would create the widget if it
doesn't exist. Use g_object_get_data() directly instead.
* gtk/gtktextdisplay.c (on_renderer_display_closed): fixed signature
of this callback.
2005-09-01 Matthias Clasen <mclasen@redhat.com>
* gdk/*.c: Intern some more strings.
* gtk/gtkintl.h:
* gtk/*.c: Define an I_() macro and use it instead of the
bulky g_intern_static_string().
2005-05-09 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_convert_0888_br, gdk_rgb_convert_8880_br):
Fill in unused bits so they can be used for the depth-32 target case.
Rewrite so that that gives a marginal speedup rather than a
marginal slowdown. (on x86)
* gdk/gdkscreen.h gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkvisual-x11.c:
Add gdk_screen_get_rgba_colormap/visual to get a visual for
windows with an alpha channel, if one exists.
* gdk/win32/gdkscreen-win32.c gdk/linux-fb/gdkscreen-fb.c:
Stub out gdk_screen_get_rgba_colormap/visual.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): computation of
"unused" wasn't right for depth == 32, since it depended on
shifting by 32.
* gdk/gdkrgb.c: Fill in alpha bits with 1s. (Based on patch from
Keith Packard,
http://mail.gnome.org/archives/gtk-devel-list/2004-June/msg00080.html)
* gdk/x11/gdkdrawable-x11.c (gdk_x11_drawable_get_picture):
Implement again, without using Xft.
* tests/testgtk.c: Add a test for windows with an alpha channel.