Commit Graph

26915 Commits

Author SHA1 Message Date
Chun-wei Fan
45cf4c7d57 gtk/gtkmenu.c: Avoid compound literals
We only start requiring compound literals from GTK+-3.90, so fix this so
that pre-C99 compilers can build GTK+-3.22 properly.
2016-10-28 15:49:29 +08:00
Matthias Clasen
c54f348edf color chooser: Fix a problem with show-editor=TRUE
For some reason we end up allocating the colorplane widget
before it is realized, and then never initialize the surface.

Fix this by explicitly doing it on realize.

https://bugzilla.gnome.org/show_bug.cgi?id=773474
2016-10-26 14:32:28 -04:00
Sébastien Wilmet
94c6d19415 docs: fix copy/paste errors in the docs of GtkScrolledWindow
Trivial commit.
2016-10-26 15:23:16 +02:00
Felix Riemann
27029a79fa GtkShortcutType: Fix typos in developer documentation
https://bugzilla.gnome.org/show_bug.cgi?id=773479
2016-10-25 20:10:24 +02:00
Matthias Clasen
e51d73afa3 Emit ::style-set after setting priv->style
This was inadvertedly changed with an optimization a while ago,
and can lead to application crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=773029
2016-10-21 14:39:10 -04:00
Jonas Ådahl
3ad1677a3a GtkMenu: Try using gdk_window_move_to_rect() more often
With best-effort, try to use gdk_window_move_to_rect() more often, when
all pieces fit together. For the non-legacy paths to be triggered for
when gtk_menu_popup_for_device() or gtk_menu_popup() were used, the
following conditions must be met:

 1) There is no custom positioning function specified
 2) The menu is attached to a widget (using gtk_menu_attach_to_widget())
 3) There is a associated grab device

https://bugzilla.gnome.org/show_bug.cgi?id=772922
2016-10-21 11:55:39 -04:00
Pavel Grunt
2b527d6e97 overlay: Document availability of properties
Add missing "Since"

https://bugzilla.gnome.org/show_bug.cgi?id=773082
2016-10-21 11:53:36 -04:00
Matthias Clasen
cd495a26b7 Deprecate gdk_window_set_debug_updates
This is gone in GTK+ 4, so lets deprecate it.
2016-10-21 10:55:16 -04:00
Matthias Clasen
a372f554eb Deprecate GtkContainer::child
It is gone in GTK+ 4, so let it deprecate here.
2016-10-21 10:21:44 -04:00
Matthias Clasen
796107c833 Deprecate gtk_window_set_wmclass
This function was already documented as "don't use", and it is
removed in GTK+ 4, so deprecate it properly.
2016-10-20 14:26:43 -04:00
Matthias Clasen
b109d25e8b Some forgotten deprecation cleanup 2016-10-20 13:58:49 -04:00
Matthias Clasen
0ca9b468b8 Deprecate gtk_drag_dest_set_proxy 2016-10-20 13:48:05 -04:00
Matthias Clasen
d3ad642519 Deprecate more to-be-removed screen apis
These will be removed in GTK+ 4, therefore, we're deprecating
them now.
2016-10-20 13:44:23 -04:00
Matthias Clasen
61fc7ddd87 Deprecate to-be-removed screen API
GTK+ 4 is removing the monitor-related screen APIs. We should
deprecate them in 3.22 so people know to port away from them.
2016-10-20 12:06:42 -04:00
Jaime Velasco Juan
0d104b041a win32 theme: Fix tooltip borders
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
ebd2487df2 win32 theme: Fix combobox
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
ad258bc81c win32 theme: Fix column headers
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
d47d342012 win32 theme: Fix popup window decorations
Windows such as combobox's popup were using toplevel window's borders

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
c46c744529 gtkwin32theme: delete #if 0 code
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
49f2ed37cd win32 theme: Fix scale widget
It was invisible before.

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
424b59aec6 win32 theme: No need to create a DC for GetThemePartSize
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
db41f815c7 win32 theme: use TS_TRUE in GetThemePartSize
Several styles return a size of 0x0px when using TS_DRAW, as
we don't pass a RECT to draw into.

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
bece404043 win32 theme: Fix scrollbars
The fix is only partial, when both scrollbars are visible their ends
overlap.

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
91d4879f82 Fix CSS warnings in win32 theme
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
eda51b4ef5 Fix tiny fonts in win32 theme
broken since df08fc91... (css: always get default font size in pixels)

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Lapo Calamandrei
e75314ec17 Adwaita: make circular button border looking nice
the darker bottom border used on buttons looks bad on circular ones
so now a gradient clipped on the border-box and a transparent
border is used in that partcular case.
See https://bugzilla.gnome.org/show_bug.cgi?id=771205 for details.
2016-10-19 15:59:33 +02:00
Lapo Calamandrei
f3d78aff12 Adwaita: sass, make button mixin export a global $button_fill var
$button_fill contains the background-image property value of
buttons, having it readable outside the drawing mixin allows, for
example, stacking background images in an easier way.
2016-10-19 15:59:33 +02:00
Lapo Calamandrei
38056d0f6e Adwaita: sass cleanup
aggregate circular button style to the main button structure.
2016-10-18 13:19:02 +02:00
Alan Jenkins
1e2e736d0d shortcutswindow: working version of set_section_name()
(testing before+after, it actually works now)

https://bugzilla.gnome.org/show_bug.cgi?id=772926
2016-10-14 10:58:17 -04:00
Christian Hergert
17bcd0d127 menusectionbox: add support for "text-direction" attribute
This allows the use of a "text-direction" hint set to one of "none", "rtl",
or "ltr" to enforce the text direction of a "horizontal-buttons"
display-hint.

This is useful when a menu has buttons that map to physical space in the
UI and therefore must match the application widgetry.

https://bugzilla.gnome.org/show_bug.cgi?id=772775
2016-10-14 10:44:57 -04:00
Alan Jenkins
45528cf5b5 scrolledwindow: fix leak of pan_gesture
https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:52:00 -04:00
Alan Jenkins
29fbeea84d headerbar: fix leak of label_sizing_box
Since the widget is not added to a container, we have the responsibility
to sink the initial floating reference, and ultimately to unref it.

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:55 -04:00
Alan Jenkins
3eb53e9e7c headerbar: fix leak of separator
https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:48 -04:00
Alan Jenkins
b3af460860 headerbar: fix leak of start_box/end_box
gtk_widget_destroy() removes widgets from their container.  However
_internal_ widgets must be unref'ed using gtk_widget_unparent() instead.
This is symmetric with the fact that these widgets were ref'ed by direct
call to gtk_widget_set_parent().  It's also the method that was used in
gtk_headerbar_destroy().

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:42 -04:00
Alan Jenkins
4100a848a7 shortcutsgroup: fix leak of title
like previous commit, albeit simpler this time

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:35 -04:00
Alan Jenkins
e2f5425a1d applicationwindow: fix leak of help_overlay
> Due to Gtk+ keeping a reference to the window internally,
> gtk_window_new() does not return a reference to the caller.
> To delete a GtkWindow, call gtk_widget_destroy().

Caller(s) aren't expecting a need to delete help_overlay themselves
once they've installed it.  (E.g. see gtk_application_window_added()).

I didn't notice any direct precedents, but there's a parallel in the
current implementation of gtk_container_destroy() which uses
gtk_widget_destroy() on any added widget.

This avoids leaking 100s of kB per window, when I tested nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:13 -04:00
Matthias Clasen
dd9a9d9dcc Deprecate gtk_menu_popup and gtk_menu_popup_for_device
These functions don't work well on backends without global
coordinates (such as Wayland or Mir), and the gtk_menu_popup_at_
variants are better alternatives.

https://bugzilla.gnome.org/show_bug.cgi?id=772552
2016-10-12 13:50:55 -04:00
Lapo Calamandrei
c41294e2be Adwaita: dodge drop active style for window and decoration nodes
to hilight drop target there is a wildcard selector which turns
the border and shadow to green, this clearly shouldn't happen when
the whole window is a drop target.
2016-10-12 19:33:40 +02:00
Christian Hergert
90ac584437 shortcuts: the accelerator should always be LTR
Even on RTL languages, we want the shortcut to be LTR so that we always
have <control> to the left of the accel keyval.

https://bugzilla.gnome.org/show_bug.cgi?id=772695
2016-10-10 15:13:48 -07:00
djb
bfc6287910 gtkplacesviewrow: stop busy_spinner from offsetting the other widgets when visible
...by putting it in a stack. The busy_spinner and eject_button are
mutually exclusive, but only the latter was coded to ensure that its
visibility did not cause the rest of the row to reflow. By putting both
widgets in a stack and setting child_visible on that, the row allocates
enough space to show one - or none - at once, avoiding any misalignment.

https://bugzilla.gnome.org/show_bug.cgi?id=772345

https://bugzilla.gnome.org/show_bug.cgi?id=772348
2016-10-10 15:14:49 -04:00
Adam Jackson
19aa3a4fca Use eglGetPlatformDisplay{,EXT} if available
Calling eglGetDisplay forces libEGL to guess what kind of pointer you
passed it. Different EGL libraries will do different things here, and in
particular glvnd will do something different than Mesa. Since we do have
an API that allows us to explicitly type the display, use it.

The explicit call to eglGetProcAddress is working around a bug in
libepoxy 1.3, which does not understand the EGL concept of client
extensions. Since it does not, the normal epoxy resolver for
eglGetPlatformDisplayEXT would not find any provider for that entry
point, and crash when you attempted to call it.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772415
2016-10-10 14:38:28 -04:00
Adam Jackson
0757914aba Fix some EGLDisplay * abuse
EGLDisplays are already opaque pointers, and eglGetDisplay returns an
EGLDisplay not a pointer to one.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772415
2016-10-10 14:37:39 -04:00
Matthias Clasen
17c08d062f entry: Fix a corner case of overwrite mode
We currently beep when a character is appended at the end in
overwrite mode. That is obviously not right. Patch based on
a patch by Ian MacDonald.

https://bugzilla.gnome.org/show_bug.cgi?id=772389
2016-10-05 12:23:18 -04:00
Christoph Reiter
ae8ffc775d widget: Don't print underallocation warnings by default
See similar changes:
    https://git.gnome.org/browse/gtk+/commit/?id=1b15588732f2c4e3c59994a59613d4e5c963e283
    https://git.gnome.org/browse/gtk+/commit/?id=54fdcb3ffac3383432b379f3e16e8cb0086b8101

https://bugzilla.gnome.org/show_bug.cgi?id=770388
2016-09-30 14:41:01 -04:00
Victor Toso
9701b58c4e icon-theme: Fix leaks on error
13 bytes in 1 blocks are definitely lost in loss record 766 of 16,875
   at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
   by 0xA9D0247: vasprintf (in /usr/lib64/libc-2.24.so)
   by 0xA2453FC: g_vasprintf (gprintf.c:316)
   by 0xA2152F7: g_strdup_vprintf (gstrfuncs.c:514)
   by 0xA21539C: g_strdup_printf (gstrfuncs.c:540)
   by 0x678F25C: gdk_rgba_to_string (gdkrgba.c:360)
   by 0x5FAE00D: rgba_to_string_noalpha (gtkicontheme.c:4322)
   by 0x5FAE6F2: gtk_icon_info_load_symbolic_svg (gtkicontheme.c:4492)
   by 0x5FAED4F: gtk_icon_info_load_symbolic_internal (gtkicontheme.c:4622)
   by 0x5FAEEE8: gtk_icon_info_load_symbolic (gtkicontheme.c:4711)
   by 0x5F00246: gtk_css_image_recolor_load (gtkcssimagerecolor.c:118)
   by 0x5F003E4: gtk_css_image_recolor_compute (gtkcssimagerecolor.c:170)

14 bytes in 1 blocks are definitely lost in loss record 801 of 16,875
   at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
   by 0xA9D0247: vasprintf (in /usr/lib64/libc-2.24.so)
   by 0xA2453FC: g_vasprintf (gprintf.c:316)
   by 0xA2152F7: g_strdup_vprintf (gstrfuncs.c:514)
   by 0xA21539C: g_strdup_printf (gstrfuncs.c:540)
   by 0x678F25C: gdk_rgba_to_string (gdkrgba.c:360)
   by 0x5FAE00D: rgba_to_string_noalpha (gtkicontheme.c:4322)
   by 0x5FAE68E: gtk_icon_info_load_symbolic_svg (gtkicontheme.c:4482)
   by 0x5FAED4F: gtk_icon_info_load_symbolic_internal (gtkicontheme.c:4622)
   by 0x5FAEEE8: gtk_icon_info_load_symbolic (gtkicontheme.c:4711)
   by 0x5F00246: gtk_css_image_recolor_load (gtkcssimagerecolor.c:118)
   by 0x5F003E4: gtk_css_image_recolor_compute (gtkcssimagerecolor.c:170)

15 bytes in 1 blocks are definitely lost in loss record 838 of 16,875
   at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
   by 0xA9D0247: vasprintf (in /usr/lib64/libc-2.24.so)
   by 0xA2453FC: g_vasprintf (gprintf.c:316)
   by 0xA2152F7: g_strdup_vprintf (gstrfuncs.c:514)
   by 0xA21539C: g_strdup_printf (gstrfuncs.c:540)
   by 0x678F25C: gdk_rgba_to_string (gdkrgba.c:360)
   by 0x5FAE00D: rgba_to_string_noalpha (gtkicontheme.c:4322)
   by 0x5FAE6C3: gtk_icon_info_load_symbolic_svg (gtkicontheme.c:4487)
   by 0x5FAED4F: gtk_icon_info_load_symbolic_internal (gtkicontheme.c:4622)
   by 0x5FAEEE8: gtk_icon_info_load_symbolic (gtkicontheme.c:4711)
   by 0x5F00246: gtk_css_image_recolor_load (gtkcssimagerecolor.c:118)
   by 0x5F003E4: gtk_css_image_recolor_compute (gtkcssimagerecolor.c:170)

16,384 bytes in 1 blocks are definitely lost in loss record 16,847 of 16,875
   at 0x4C2DADE: malloc (vg_replace_malloc.c:298)
   by 0x4C2FC91: realloc (vg_replace_malloc.c:785)
   by 0xA1F89FA: g_realloc (gmem.c:159)
   by 0xA1BAD2E: g_array_maybe_expand (garray.c:779)
   by 0xA1BA566: g_array_set_size (garray.c:555)
   by 0xA1BBCB8: g_byte_array_set_size (garray.c:1752)
   by 0x8D1CC48: g_file_load_contents (gfile.c:6766)
   by 0x5FAE767: gtk_icon_info_load_symbolic_svg (gtkicontheme.c:4501)
   by 0x5FAED4F: gtk_icon_info_load_symbolic_internal (gtkicontheme.c:4622)
   by 0x5FAEEE8: gtk_icon_info_load_symbolic (gtkicontheme.c:4711)
   by 0x5F00246: gtk_css_image_recolor_load (gtkcssimagerecolor.c:118)
   by 0x5F003E4: gtk_css_image_recolor_compute (gtkcssimagerecolor.c:170)

https://bugzilla.gnome.org/show_bug.cgi?id=772215
2016-09-30 14:20:01 -04:00
Carlos Garnacho
769ee1156d popover: Update scrollable on relative-to hierarchy changes
The relative-to widget may be reparented itself into/out of a
scrollable. In this cases make the hierachy-changed handler to
unset the parent scrollable when unparented, and look up again
the parent scrollable after it's reparented.

https://bugzilla.gnome.org/show_bug.cgi?id=771812
2016-09-29 12:46:34 +02:00
Carlos Garnacho
588a1dce2b popover: Add helper functions around setting up an scrollable
gtk_popover_set_scrollable_full() takes care of the signal connected
on the scrollable itself, in addition to the adjustment signals the
popover listens to.

gtk_popover_update_scrollable() looks up the current relative-to
widget hierarchy and updates the current scrollable.

The places where the scrollable is being maintained have been updated
to use these functions.

https://bugzilla.gnome.org/show_bug.cgi?id=771812
2016-09-29 12:46:34 +02:00
Christian Hergert
73d09c8f74 scrolledwindow: handle NULL cursor safely
It's possible to get a NULL cursor back if there are improperly
configured or missing cursors on the system.
2016-09-28 12:37:41 -07:00
Olivier Fourdan
dbd0923b5f wayland: Avoid negative size constraints
Setting the shadow width earlier as done with commit 4cb1b96 to address
bug 771561 proved to cause unexpected side effects on size_allocate
signal propagation.

As the window is sized correctly earlier, the size_allocate signal is
not emitted again in gtk_widget_size_allocate_with_baseline() which
prevents clutter-gtk from relocating its child widget correctly.

To avoid this issue, revert commit 4cb1b96 but make sure the values
passed as min and max size is never negative in Wayland as this is a
protocol error.

With this, the min/max size will be wrong for a short amount of time,
during the state transition, until the shadow width is updated from
gdk_window_set_shadow_width().

This approach is much safer and less intrusive than changing the
size_allocate logic in gtk.

This reverts commit 4cb1b9645e.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=771915
2016-09-28 09:28:52 +02:00
Christian Hergert
b684b23c74 entry: handle NULL cursor when updating cursors
If we got a NULL cursor from gdk_cursor_new_from_name(), we need
to handle that when unreffing.
2016-09-27 14:12:43 -07:00