Add a has-tab-gap style property to GtkNotebook so that we can
disable drawing the gap between tabs and the page in the Adwaita
theme without breaking existing themes.
https://bugzilla.gnome.org/show_bug.cgi?id=707920
GtkSourceView draws before chaining upo to GtkTextView and assumes
that this will be visible, but the pixelcache will just overdraw
that with background.
So, we stop drawing the background to the pixel cache and instead
make it an CAIRO_CONTENT_COLOR_ALPHA surface to make the previously
drawn content see through.
This is slower, but more backwards compatible.
https://bugzilla.gnome.org/show_bug.cgi?id=708423
Previously, we were showing and hiding the custom titlebar
widget in response to state changes such as maximization.
Instead, use gtk_widget_set_child_visible() and leave
show/hide to applications. This makes it possible to set
a custom titlebar and hide it, for a titlebar-less appearance.
https://bugzilla.gnome.org/show_bug.cgi?id=707132
When loading a symbolic icon, g_file_get_contents() is currently used
with the icon pathname, to load its SVG data. This won't work when the
icon is not a local file, for instance when a symbolic icon is loaded
from a GFileIcon with a GResource path.
Fortunately GtkIconInfo already holds a GFile, so we can just use
g_file_load_contents() to load the data instead.
https://bugzilla.gnome.org/show_bug.cgi?id=709056
Updated documentation to specify that '0' should be specified if
one does not need to automatically assign a bound child to a public
or private instance member (now that negative values are private
structure offsets).
If we start with a padding of -1 then it can leak out of the size
allocation request for the column when the treeview is empty. The
GtkTreeView will then collect these -1 values and add them together,
returning -n where 'n' is the number of columns.
This is usually not a problem because treeviews tend to be used with a
scrollbar and the width of the scrollbar will be added to this number
bringing it into positive territory again. On Ubuntu, with overlay
scrollbars, this is not the case, however.
https://bugzilla.gnome.org/show_bug.cgi?id=703062
The size of the shadow and invisible borders can (and usually
will) change between backdrop and focused windows, while the
overall window size remains unchanged. This causes the visible
window to visually 'jump'. We can avoid this by always reserving
the maximum of the focused and unfocused border sizes. The code
for positioning the input-only windows making up the invisible
border is adjusted to deal with this. We now always place the
invisible border right outside the visible content, even if the
shadow extends out much farther.
https://bugzilla.gnome.org/show_bug.cgi?id=707524
And use the "header" style class to do that.
This allows themes to set e.g. the background of the tab header
differently.
Themes will need slight adjustment to make things appear
as before.
https://bugzilla.gnome.org/show_bug.cgi?id=643914
This allows subclasses of GtkTextView that require a corresponding
subclass of GtkTextBuffer to automatically do the right thing when
constructed with a NULL buffer. An example of this is GtkSourceView
which requires a GtkSourceBuffer.
https://bugzilla.gnome.org/show_bug.cgi?id=708584
The GtkStack and GtkStackSwitcher code did not really
follow GTK+ conventions for includes. Fix that, and also
fix up a case of gpointer vs gpointer* confusion
in gtkstack.c.
This adds new 'over' and 'under' transitions which work by moving
the new page over the previous one, or moving the previous page off
to reveal the new one. We also add an over/under combination that
is going to be used in GtkAboutDialog.
https://bugzilla.gnome.org/show_bug.cgi?id=707187
Some of the labels were not marked as no-show-all. But the
code clearly tries to manage their visibility, so gtk_widget_show_all()
should not affect them.
https://bugzilla.gnome.org/show_bug.cgi?id=681484
The child property is watched by the StackSwicther which in turns sets a
needs-attention css class on the corresponding button, so that the theme
can for instance show a throbbing animation if one of the hidden pages
needs the user attention.
https://bugzilla.gnome.org/show_bug.cgi?id=707153
If an icon is in a Fixed or Threshold directory we normally don't
scale it. However, in the case of HiDPI scaling we *do* want to
scale it, to avoid different layouts in Lo/HiDPI. We look up whatever
the size of the icon would have been in LoDPI and scale to that
in the no-scaling case, thus getting the same layout as the
unscaled case.
https://bugzilla.gnome.org/show_bug.cgi?id=708384
GdkPixbuf will fail returning %NULL if we try to scale a pixbuf to (0, 0),
which will then trigger an assertion in gtk_icon_info_load_icon_finish();
we never want a scale of 0, so ensure it is at least 1.
https://bugzilla.gnome.org/show_bug.cgi?id=708384
We need to subtract border_width from the size we're passing to the
children hfw functions as those are added by ourselves.
Fixes the window-border-width.ui reftest.
Previously, when you clicked and held the button down on a
GtkExpander's label or disclosure triangle, then moved the mouse
away and released the button, the expander would still activate.
This brings the behavior in line with the more generally expected
behavior, as exhibited by GtkButton for example.
https://bugzilla.gnome.org/show_bug.cgi?id=706345
This allows GTK+ applications with headerbars to fit in
better in platforms that have window controls on the left.
To use this, set -GtkWindow-decoration-button-layout: 'close:'
in the theme.
https://bugzilla.gnome.org/show_bug.cgi?id=706708
At least for header bars, there's often application controls
in this area, which should be included in the focus chain.
We make it so that the initial focus avoids the titlebar,
but tabbing around will eventually get there.
https://bugzilla.gnome.org/show_bug.cgi?id=708067
This reverts commit 7cecc8e524.
It is impossible to use the selection object of the menu while it is
collapsed (collapsed menus deselect everything for a start), so even
though the original patch was correct, the followup issues are too big
to solve this quickly to a release.
https://bugzilla.gnome.org/show_bug.cgi?id=707786
* gtk/gtkwidget.c: drag-leave signal: Document that it is called before
drag-drop.
drag-data-received signal: Document that it is up to the application
to know why the data was requested (e.g. drag motion or drop).
* demos/gtk-demo/toolpalette.c: interactive_canvas_drag_drop():
Do not transform the drop_item created in the drag-motion handler.
Instead caused drag-data-received to be called, remembering why,
and create a new item there.
interactive_canvas_drag_leave(): Remove the idle-handler hack,
now that we do not need to keep the drag-motion drop_item alive until
the drop.
I noticed that this patch was sitting in bug #605611 from 2009
though it had been approved. I do not remember much about why I
created it.
This is the same behaviour as gtk_widget_get_valign, except
we have no gtk_wiget_get_halign_with_baseline, as baselines make
no sense for halign.
Without this some widgets (like e.g. GtkOverlay) crash if you accidentally
set a BASELINE halign.
It is more logical to first delete the selection and then pasting the
text. When the selection and the text contain tags, the new behavior is
more natural.
A segfault in paste_from_buffer() is also avoided. The segfault occurs when
the text to paste is deleted because it is the selection.
https://bugzilla.gnome.org/show_bug.cgi?id=339539
Move GtkWrapMode from GtkTextTag to the GtkTextView section. The wrap
mode property is in the text view.
Links to the "mark-set" and "mark-deleted" signals.
Add a precision about gtk_text_buffer_get_iter_at_line().
Fix typo in gtk_text_tag_set_priority().
https://bugzilla.gnome.org/show_bug.cgi?id=708076
A proper name or label is required. In the same way, if the
widget is labelled, ATs uses to expose both the label and the
name, making the final output not really user-friendly.
https://bugzilla.gnome.org/show_bug.cgi?id=707872
keyboard navigation didn't support activation since we moved
the keynav to the child row widgets. We fix this by adding a
activate signal handler for the row and setting
widget_class->activate_signal to it.
https://bugzilla.gnome.org/show_bug.cgi?id=707778
This reverts commit 70ac2b24c3.
It turns out the correct fix is to make pango_layout_get_text() not
return NULL. This has been done, so we can drop this patch.
I won't bump the Pango dependency in configure.ac for this as I don't
consider the crash critical enough.
Use the pixelcache rendered area to inform what part of the cache should
be invalidated upon changes to the underlying textlayout.
By rendering the background to the pixelcache, we can avoid the need to
use RGBA content.
Also, we're using the pixel cache on the text windows bin_window (see
gtk_text_view_get_window) so we need to register the invalidation handler
on that, otherwise the region passed to the invalidate handler will get
clipped to the visible region.
https://bugzilla.gnome.org/show_bug.cgi?id=707244
We added code to look for settings.ini in system config dirs,
and then proceeded to move it to /usr/share/gtk-3.0 :-(. So,
look in that location as well.
We now pass NULL when the current color should be the default value of
the "color" property and we haven't looked up any value yet. This way we
don't need to look it up all the time and more importantly we can
resolve the default color, which is required because it's a
GtkCssColorValue and not a GtkCssRgbaValue.
Fixes assertions triggering at Polari startup.
The version of device scale that landed in upstream cairo
master already inherits the device scale in cairo_create_similar,
so no need to do that in gtk anymore.
Even when not following states, blacklist the states we don't follow
instead of whitelisting the ones we do. This way, we don't accidentally
eat new ones like the text direction flags.
Fixes a bug where text direction wasn't available when rendering stock
items.
https://bugzilla.gnome.org/show_bug.cgi?id=702423
If the compositor supports the gtk-shell interface, use it to
export the application ID, dbus name and paths that can be used
for the application menu.
https://bugzilla.gnome.org/show_bug.cgi?id=707129
Call gtk_widget_get_mapped() in a couple of places before looking at the
widget's parent, since it might be set to a widget that has been
finalized, causing an invalid read.
GTK+ tries to automatically assign the best input module based on the
'system locale'. In the specific case of the IME input method, it will
be the default for the whole GTK+ application if the system locale is
either Japanese (ja), Korean (ko) or Chinese (zh). Other defaults are
equally applicable, e.g. if system locale is Catalan (ca), the special
'Cedilla' input module is chosen.
System locale can be changed (e.g. Win7) through the following sequence
(reboot required):
Control Panel
Region and Language
Administrative
Language for non-Unicode Programs
Change system locale...
The problem with this behaviour is that changing the 'default input
language' (e.g. from English to Japanese+IME) doesn't affect the GTK+
application. Therefore, I can have an English system locale (where GTK+
will choose Simple IM by default) but then have Japanese+IME as input
language.
Default input language can be changed (e.g. Win7) through the following
sequence (no reboot required):
System locale can be changed (e.g. Win7) through:
Control Panel
Region and Language
Keyboards and Languages
Keyboards and other input languages
Change keyboards...
Default input language can also be changed using the language bar directly.
So, instead of using the system-wide default locale to decide which input
method to use as default, better use the input language specified by the
user, which may be the same as the system-wide default locale, or different.
Following the previous example, with an English system locale and a
Japanese+IME input language, the default input method will now be IME
instead of Simple, which is closer to what's expected by the user.
This change only affects the application during startup; i.e. if the user
changes the input language while the application is running, we wouldn't be
changing the default input method to use. We could do this processing the
WM_INPUTLANGCHANGE messages, though.
https://bugzilla.gnome.org/show_bug.cgi?id=700428
Call gtk_widget_get_mapped() in a couple of places before looking at the
widget's parent, since it might be set to a widget that has been
finalized, causing an invalid read.
GtkAssistant is bending the rules about child properties
of non-direct children, and the recent fix to accomodate
GtkInfoBar changes broke things. The effect was that child
properties of assistant pages in ui files were just not
applied, so all pages ended up without titles and with
the normal page type, leading to broken assistants all
over the place.
https://bugzilla.gnome.org/show_bug.cgi?id=706756
GtkAssistant supports not showing the sidebar with the page
titles (if the page have no titles). Unfortunately, we were
hiding the sidebar in this case, but still rendering the frame
behind it, leading to a broken appearance.
Horizontal scrolling is unusual, but specifying some extra offscreen
space for it in free in the normal case where the viewport is the
same width as the canvas anyway, so lets do it.
If the new requested surface size is enough larger than the previous
one (but the old is still larger than the absolute minimum),
reallocate it anyway.
This fixes an issue where the text view initially requested a really
small extra size which was then increased but that didn't "take".
This patch uses GtkPixelCache to render the contents of the widget,
and typically a bit more, to an offscreen surface. The pixel cache in
turn manages rendering to the actual surface for the widget.
The current strategy for the size to render is the size of the widget
plus half the height.
https://bugzilla.gnome.org/show_bug.cgi?id=701125
There were some code added to this file that is meant for the X11 backend,
but they are being unconditionally built. Add build-time checks for the
X11 backend for these to fix the build on non-X11 platforms.
Due to the work on gdk_cursor_new_from_surface (commit b2113b73),
get_cursor_for_pixbuf() in GdkDisplayClass was converted to
get_cursor_for_surface(), which means the GDK Win32 backend needs to be
updated for the code to build and run on Windows, plus some function
prototypes and declarations/calls need to be updated as well.
https://bugzilla.gnome.org/show_bug.cgi?id=705980
We'll use a style class to be able to give this a different appearance,
but for the time being we don't really need to give this such different
margin.
https://bugzilla.gnome.org/show_bug.cgi?id=706592
When setting the lines property, the label will be ellipsized
to that many lines, with the ellipsis only appearing in the
last line. This is different from how ellipsization of multi-line
labels normally works in GTK+.
"title_box" is used for both a custom header bar and for a titlebar.
Since we want to help differentiate these cases in the code, rename
everything titlebar-internal to use "titlebar_".
https://bugzilla.gnome.org/show_bug.cgi?id=706529
This used to point to the GtkPathBar, which doesn't accept mnemonic activation, anyway.
This whole thing was a leftover from when we had a combo box to select a folder, but
this is no longer the case.
https://bugzilla.gnome.org/show_bug.cgi?id=706448
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This way, the Wayland and the regular clipboard implementation can both
be compiled in and selected based on the display in use.
One thing potentially broken now is text mime type handling as Wayland
seemed to use different mime types in some places.
The state of the widget is not enough now to cache the pixbuf - we also
have to take into consideration the image effect itself, since the state
on the actual GtkStyleContext we use might not change, e.g. because the
change was on a parent context.
https://bugzilla.gnome.org/show_bug.cgi?id=705443
We should set the appropriate style classes when we have
constructed the content and know if it is a label, an image,
or both. Doing this in the convenience constructors is
problematic for language bindings, and misses out when the
content is changed after construction.
I'm currently working on porting view::FieldEntry (from libview) to C for use in
upstream GTK+. FieldEntry is a widget which allows users to enter structured
text such as IPv4 addresses or serial numbers. The way that FieldEntry
delineates the fields within the entry is with tabstops, using PangoTabArray
entries to precisely position the fields and delimiters. Because GtkEntry
rebuilds its internal PangoLayout fairly frequently, this requires a property in
the entry that will set the tabs on the layout whenever that happens. This API
looks very similar to one in GtkTextView.
Patch by David Trowbridge <trowbrds@gmail.com>. Updated for Gtk+ 3.10.
https://bugzilla.gnome.org/show_bug.cgi?id=697399
GtkEntry currently draws exactly the same no matter what the state of the
'editable' property. This is pretty confusing for users because there's
no visual feedback at all, it just seems like their keyboard is broken.
This change adds a "read-only" class to the StyleContext, which will
continue to allow the user to select/copy the text, but will draw the
entry as if it were insensitive, providing some indication that the
contents can't be changed.
Signed-off-by: David Trowbridge <trowbrds@gmail.com>
http://bugzilla.gnome.org/show_bug.cgi?id=694831
For backwards compat support we don't want old implementations not
supporting scaling to see the new scaled directories, so move these
to a separate list.
Keyboard activation relies on the menu not being visible,
so ensure that it isn't when the menu is attached.
Problem tracked down by Vincent Le Garrec,
https://bugzilla.gnome.org/show_bug.cgi?id=688738
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.
To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.
https://bugzilla.gnome.org/show_bug.cgi?id=697127
This reverts commit b2e666bf8f.
We need to keep cursor blinking configurable for accessibility
reasons.
https://bugzilla.gnome.org/show_bug.cgi?id=704134
Conflicts:
gdk/win32/gdkproperty-win32.c
gdk/x11/gdksettings.c
gtk/gtksettings.c
gtk/gtktextview.c
The rsvg loader now restricts what external files it will
allow to load from an svg. Thus our xinclude trick doesn't work
anymore. To work around that, embed the payload in a data: uri.
This is somewhat ugly, but the best we could come up with.
The current theme just makes all text bold that appears anywhere
in a headerbar, which is not great. We add 'title' and 'subtitle'
style classes to allow more targeted overriding of the font.
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.
Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.
https://bugzilla.gnome.org/show_bug.cgi?id=705605
Fixes:
(rhythmbox:22802): Gtk-CRITICAL **:
_gtk_widget_get_preferred_size_for_size: assertion 'size >= -1' failed
that is gtk_paned_get_preferred_size_for_opposite_orientation calls
_gtk_widget_get_preferred_size_for_size on child2 with a negative
size.
As gtkpaned size was (32), child1 minimum size was (55) then
for_child1 became (32) for an handle_size of (5). Thus for_child2
ended up as (-5).
https://bugzilla.gnome.org/show_bug.cgi?id=705624
Just as for GtkRangeAccessible, we were not even trying to disconnect
the signal handler from the adjustment. The same fix works here:
override the widget_set and widget_unset vfuncs.
https://bugzilla.gnome.org/show_bug.cgi?id=705692
We were only disconnecting the signal in finalize, when
the widget was already unset. Instead, override the widget_set
and widget_unset vfuncs of GtkAccessible, and keep a reference
to the adjustment.
https://bugzilla.gnome.org/show_bug.cgi?id=705692
Replace the deprecated API calls with the updated APIs, and fix the build
of modules/input/gtkimcontextime.c, as we really needed
gdk/gdkkeysyms-compat.h (gdk/gdkkeysyms.h was already included)
https://bugzilla.gnome.org/show_bug.cgi?id=705068
Make sure we always deal with the same screen when
connecting / disconnecting the theme-variant changed handler.
Pointed out by Morten Welinder in
https://bugzilla.gnome.org/show_bug.cgi?id=705640
When an icon is requested as symbolic, our generic fallback algorithm
uses fullcolor icons when the specified icon name is not found, treating
the "-symbolic" suffix as another component of the icon name.
Change the algorithm to check beforehand if the icon is symbolic, remove
the suffix if so, and re-add it at the end for all the generated icon
names.
https://bugzilla.gnome.org/show_bug.cgi?id=680926