Commit Graph

29754 Commits

Author SHA1 Message Date
Chun-wei Fan
a687fd9aeb gtk/gskpango.c: Use g_snprintf()
This fixes the build of GTK+ master on Visual Studio 2013 (and possibly
others) as snprintf() may not be supported even if the required C99
features are supported by the compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-21 14:22:23 +08:00
Chun-wei Fan
8059975f74 gtk/gtkseclection.c: Don't build X11 items unconditionally
Limit building the X11 items only when GDK_WINDOWING_X11 is defined.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-21 14:16:19 +08:00
Benjamin Otte
c82378ea57 gdk: Add GType support to GdkContentFormats
This is not used by anything yet, but add it now, so people looking at
this new code can make sense of it.
Plus, the documentation mentions it, so better have the docs make sense.

It will be used once we add support for conversions to GDK and allow
doing cipboard/dnd by GValue.
2017-11-20 23:22:28 +01:00
Benjamin Otte
1a70ca75e8 gdk: Sanitize GdkContentFormats API
Make sure the API reflects the idea that GdkContentFormats is a set
containing mime types. In particular, treat the object itself as a
plural - it's named content format`S' after all - and therefor use
the correct verb form.

Also make GdkContentFormats keep an array instead of a list, now that
it's immutable.
2017-11-20 23:15:11 +01:00
Benjamin Otte
fc2ce5a925 gdk: Make GdkContentFormats immutable 2017-11-20 23:13:10 +01:00
Benjamin Otte
d6a209816b gdkdnd: Make GdkDragContext->formats a GdkContentFormats
Instead of it being a GList of GdkAtoms.
2017-11-20 23:12:33 +01:00
Benjamin Otte
9a6ec4e959 contentformats: Rename GtkTargetList
It's now called GdkContentsFormat
2017-11-20 23:12:33 +01:00
Benjamin Otte
0638bbb5d5 gdk: Move GtkTargetList to GDK
It's gonna be renamed next, so put it in the right source file already.

For now retain the old name to keep the diff small.
2017-11-20 23:12:33 +01:00
Benjamin Otte
0b40ad32f3 selection: Make GtkTargetList members private
Outside of the target list, don't access it directly, instead use public
APIs like the newly introduced gtk_target_list_intersects().
2017-11-20 23:12:33 +01:00
Benjamin Otte
c863ac0f90 dnd: Remove GtkTargetEntry and GtkTargetFlags
warning: We don't do any same-app checks anymore so you currently can
copy local data into external apps.

This will be fixed later.
2017-11-20 23:12:33 +01:00
Matthias Clasen
49d02eff93 emoji chooser: break out a helper function
This is just a small cleanup.
2017-11-19 22:43:36 -05:00
Matthias Clasen
5a6c6070d6 remove debug spew 2017-11-19 22:43:36 -05:00
Matthias Clasen
4d9b7b2359 entry: Add a key binding for the emoji chooser
Make Ctrl-. and Ctrl-; bring up the emoji chooser.

https://bugzilla.gnome.org/show_bug.cgi?id=789160
2017-11-19 18:06:19 -05:00
Matthias Clasen
1cd5df9404 emoji chooser: Make menu key work as expected
Whenever we have a right-click action, we should make
the menu key work as a keyboard-accessible alternative.
2017-11-19 18:04:38 -05:00
Matthias Clasen
d3a358b9bd Adwaita: Bring fix focus in flowbox
Bring back the focus rectangle for flowbox children.
Its absence makes keynav in flowboxes really difficult.
2017-11-19 18:04:31 -05:00
Matthias Clasen
5e748ce940 emoji chooser: handle right-click
Whereever we handle long-press for touch, it makes sense to handle
right-click as a faster alternative for mouse-based interaction.

This commit makes right-click work to bring up the variation
selector for Emojis.
2017-11-19 18:04:26 -05:00
Matthias Clasen
4d0a57fe0b listbox: Listen to ::stopped on the press gesture
Otherwise, we end up interpreting grab notify's as
button releases, which is not right. This matches
what GtkFlowBox does.
2017-11-19 14:49:58 -05:00
Matthias Clasen
2f9d980c93 Trivial cleanup
Better to use G_SOURCE_REMOVE than FALSE, for clarity.
2017-11-19 09:28:00 -05:00
Matthias Clasen
1f8debbac9 emoji chooser: Don't leak gestures
We were not freeing these gestures as we should.
2017-11-19 09:27:53 -05:00
Matthias Clasen
a8531605db Some more interning
This avoids more strdups at startup.
2017-11-18 08:18:11 -05:00
Matthias Clasen
997f0de4d5 a11y: Intern a string 2017-11-17 23:25:45 -05:00
Matthias Clasen
7dded559c0 cell area: Use GTK_PARAM_READWRITE consistently 2017-11-17 23:25:07 -05:00
Matthias Clasen
7c4a1a596f icon helper: Avoid a few string copies 2017-11-17 23:21:24 -05:00
Matthias Clasen
8c06cd5f98 styleproperty: Use G_PARAM_STATIC_STRINGS 2017-11-17 22:56:25 -05:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Matthias Clasen
dd7163a699 settings: Use gdk_display_set_cursor_theme
This allows us to reduce the amount of ifdef ugliness.
2017-11-17 17:56:03 -05:00
Matthias Clasen
2d591cde78 Include gdk-private.h
This gives us access to private gdk api.
2017-11-17 16:34:04 -05:00
Matthias Clasen
4865c3273a clipboard: Use gdk_display_get_last_seen_time
This removes the backend dependent code from gtkclipboard.c.
A good thing!
2017-11-17 15:40:49 -05:00
Benjamin Otte
594aae71e5 toolbar: Remove gdk_flush() calls
It's not 2003 anymore.
2017-11-17 08:07:27 +01:00
Benjamin Otte
0019178014 main: Don't gdk_flush() after every main loop wait
For a start, this makes gtk_main() work different from g_main_loop_run()
calls.

But most importantly, modern GDK does proper syncing itself and doesn't
need to rely on a catch-all to get it right.
2017-11-17 08:07:10 +01:00
Matthias Clasen
daacd25344 selection: Use x11-specific traps
The generic trap api is going away.
2017-11-16 23:42:55 -05:00
Matthias Clasen
8b3e9fe35c mountoperation-x11: Use x11-specific traps
The generic trap api is going away.
2017-11-16 23:36:21 -05:00
Matthias Clasen
95876cbc9c Remove gdk/gdkx.h
It was just a kludge.
2017-11-16 23:00:01 -05:00
Matthias Clasen
dca8c8e189 gtk: Stop using gdk_notify_startup_complete_with_id
This function is about to go away. Instead, use the
display-specific function that this is a wrapper of.
2017-11-16 22:45:04 -05:00
Benjamin Otte
3f5178dc21 selection: Remove the info uint
Instead of allowing people to pass a uint user-data, insist on them
comparing mime types.

The user data was a uint instead of a pointer anyway, so uniqueness
could not be guaranteed and it caused more issues than it was worth.
And that's ignoring the fact that it basically wasn't used.
2017-11-16 22:59:43 +01:00
Benjamin Otte
5da3059175 selection: Remove gtk_target_table_*() functions 2017-11-16 22:59:42 +01:00
Benjamin Otte
b200d4f099 textview: Stop playing shenanigans with the target list
This breaks GtkSourceView adding custom targets on top of GtkTextView,
but we'll fix that later.
2017-11-16 22:59:42 +01:00
Benjamin Otte
47e75b34a4 selection: Make GtkTargetEntry not allocatable
And remove it being registered as a boxed type (lol).
2017-11-16 22:59:42 +01:00
Matthias Clasen
e62ec97707 HighContrast: misc fixes
The HighContrast theme was not parsing anymore, due to
leftover widget style properties, and some missed cleanups,
like -gtk-icon-effect. Also update for the new focus handling,
and make checks and radios sharp again.
2017-11-15 18:08:46 -05:00
Matthias Clasen
a4c4df3b95 Adwaita: Make checks and radios sharp again
The assets we have are 14x14, set -gtk-icon-size to reflect that.
2017-11-15 18:07:52 -05:00
Matthias Clasen
d9a146f54a Change icon-size properties
We no longer support registering custom icon sizes, so
we can make these properties just enums. This also lets
us specify them by nick in ui files. Nice!
2017-11-15 14:22:17 -05:00
Matthias Clasen
a28cf475af image: Update docs
Mention the new icon-size style classes, update the docs
for removed arguments and return values, and add new
functions to the docs.
2017-11-15 14:22:17 -05:00
Matthias Clasen
43a9b82797 Support -gtk-icon-size for builtins
This makes css icons more similar to themed icons, which
is the overall goal here.
2017-11-15 14:22:17 -05:00
Matthias Clasen
0d23606653 Drop gtk_icon_size_lookup
Add a new, private gtk_image_get_image_size to replace it, and
update the remaining callers in a suitable way.
2017-11-15 14:22:17 -05:00
Matthias Clasen
866ff2b8f0 recentchooser: Use GIcon instead of GdkPixbuf 2017-11-15 14:22:17 -05:00
Matthias Clasen
c6c3427507 iconhelper: Query size via CSS
Instead of looking at the icon size, look at the CSS value for
-gtk-icon-size. Set style classes depending on icon size instead.

Trivially change Adwaita and HighContrast to report the same values as
before.
2017-11-15 14:22:17 -05:00
Matthias Clasen
2301d8d90b enums: Change GtkIconSize values
The new values are the ones we intend to keep. The old ones had
duplicated meanings and nobody knew which one to take.
2017-11-15 14:22:17 -05:00
Benjamin Otte
e5da85631a image: Don't take icon size in set_from_definition() 2017-11-15 14:22:17 -05:00
Matthias Clasen
67268bcc23 filechooserwidget: icon size is always 16 2017-11-15 14:22:17 -05:00
Matthias Clasen
b598a5ab78 filechooserbutton: icon size is always 16
So define it that way.
2017-11-15 14:22:17 -05:00
Benjamin Otte
e0a5f4e081 cellrendererspinner: Don't track old icon size
It was only used to avoid gtk_icon_size_lookup() calls and those aren't
expensive.
2017-11-15 14:22:17 -05:00
Matthias Clasen
dbfaa99107 image: Remove icon-size argument from icon setters
Instead, add a function gtk_image_set_icon_size() for the cases where
overriding the icon size is necessary.

Treat icon sizes the same way as pixel sizes, too. So gtk_image_clear()
no longer unsets the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
049cc6aa01 image: Change getters
Instead of returning the icon size with them, make
gtk_image_get_icon_name() and gtk_image_get_gicon() only return the icon
itself.

As a benefit, we can turn them into regular getters that return values
instead of requiring out parameters.

Instead, provide gtk_image_get_icon_size() to query the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
f53b72e5ff button: Get rid of icon size
In fact, make gtk_button_new_from_icon_name() just set the icon-name
property instead of creating a GtkImage.
2017-11-15 14:22:16 -05:00
Benjamin Otte
3da65ff233 scalebutton: Remove icon size 2017-11-15 14:22:16 -05:00
Benjamin Otte
a7754a14b5 toolbar: Remove icon sizes 2017-11-15 14:22:16 -05:00
Benjamin Otte
8df61992d7 tooltips: Remove GtkIconSize usage 2017-11-15 14:22:16 -05:00
Benjamin Otte
129dc7d73b css: Add -gtk-icon-size
This will replace GtkIconSize in future patches.
2017-11-15 14:22:16 -05:00
Benjamin Otte
dcc2577b97 introspection: Fix build 2017-11-15 19:33:26 +01:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Benjamin Otte
5a1a11bcde dnd: Make GtkDragDest and GtkDragSource use GtkTargetList
This gets rid of GtkTargetEntry in the API and consistently uses
GtkTargetList.
2017-11-15 19:07:17 +01:00
Benjamin Otte
7efc5a1558 clipboard: Consistently use GtkTargetList
Some code was using GtkTargetList, some used GtkTargetEntry and some
GtkTargetPair.
2017-11-15 19:07:16 +01:00
Benjamin Otte
fb94f79094 selection: Remove #ifdef WAYLAND
Instead, turn the functions into backend API:
  gdk_broadway_display_add_selection_targets()
  gdk_broadway_display_clear_selection_targets()
Remove the old per-backend functions, too.
2017-11-15 19:07:16 +01:00
Benjamin Otte
13ca03efb1 cellrendererpixbuf: Remove stock-detail property
GTK3 didn't use that property already...
2017-11-14 18:37:38 -05:00
Benjamin Otte
515b13fdd5 messagedialog: Remove unused header 2017-11-14 18:24:43 -05:00
Benjamin Otte
77efc60a15 placessiderbar: Fix sunny compilation
Make compilation not warn about unused variables when compiling with
HAVE_CLOUDPROVIDERS undefined.
2017-11-13 23:45:18 +01:00
Benjamin Otte
457bf3b604 widget: No need to update events
GtkWindow queues for all events anyway, so the needed ones are already
there.
2017-11-13 23:41:38 +01:00
Benjamin Otte
ed1b6a9bed gdkwindow: Remove event_mask arguments from constructors 2017-11-13 23:41:38 +01:00
Benjamin Otte
9d56cee622 widget: Remove gtk_widget_set_device_enabled()
Nobody is using it.
2017-11-13 23:41:37 +01:00
Matthias Clasen
724863c275 icontheme: Add a trailing / when enumerating resources
This avoids extra string copies in GResource.
2017-11-13 12:13:42 -05:00
Carlos Soriano
1b1cb8295b gtkplacessidebar: Fix new tab/window handling for cloud accounts
It wasn't taking into account whether the sidebar had support for them
or not, resulting in a file chooser with open in new tab/window menu
items when it's not supported.

To fix it, do as with the other menus and check for the availability of
new tab/window flags.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-11-13 16:57:02 +01:00
Carlos Soriano
f54e7712c5 gtkplacessidebar: Adapt to libcloudproviders 0.2.x
And a few improvements on the way.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-11-13 16:55:10 +01:00
Matthias Clasen
2ff175938d application: Append a / to the icon resource path
g_resources_enumerate_children expects the path to end
in a '/' (even though thats not stated in the docs), and
will copy it if that isn't the case. Avoid the copy
by putting  a '/' there to begin with.
2017-11-13 07:35:18 -05:00
Matthias Clasen
ec1ea0db04 icontheme: Append a / to the resource path
g_resources_enumerate_children expects the path to end
in a '/' (even though thats not stated in the docs), and
will copy it if that isn't the case. Avoid the copy
by putting  a '/' there to begin with.
2017-11-13 07:33:35 -05:00
Benjamin Otte
e0d3602331 a11y: Handle a treeview with no columns
Code was spewing criticals to stderr because of nonexisting columns. So
check that there's actually an existing column first.
2017-11-13 03:51:53 +01:00
Benjamin Otte
b968147e0a treeview: Only update vadjustment in size_allocate()
The 2 calls even do different things, but because the one in allocate
always overrides the one here...
2017-11-13 01:53:45 +01:00
Benjamin Otte
f31a51a1c8 treeview: Pass height to allocate as argument
Instead of exporting a function to query it.
2017-11-13 01:28:16 +01:00
Benjamin Otte
b47ff72ebc progresstracker: Don't hand out NaN
When the duration is set to 0, clamp it to 1us. This way we're almost
correct: We should really instantly finish, but we don't. But we do
respect the delay.

Doing this properly would require some refactoring of how the progress
tracker actually maintains progress, and this is just a quick fix.
2017-11-12 06:22:34 +01:00
Benjamin Otte
6eead8f6a3 treeview: Use gtk_widget_get_width()
... instead of gtk_widget_get_allocated_width() and same for height.

This makes the treeview do the right thing when used with padding.
2017-11-12 05:46:06 +01:00
Benjamin Otte
61ecd10240 treeview: Don't allocate columns outside of size_allocate() 2017-11-12 05:38:58 +01:00
Benjamin Otte
5db1aa5401 treeview: Fix RTL column header allocation 2017-11-12 05:37:06 +01:00
Benjamin Otte
48de0bf741 treeview: width_changed is always true, so remove it
Also, sanitize the RTL correction code that made sure resizing the width
of a treeview would keep the contents glued to the right border instead
of the left border.
2017-11-12 05:31:21 +01:00
Matthias Clasen
f40b3bc5bc Fix up managed dnd
Since commit 6c56d04cee,
we were doing some calls twice in the managed dnd case,
leading to double drops.
2017-11-11 07:50:11 -05:00
Benjamin Otte
af13d474e8 textview: Remove GDK windows 2017-11-11 05:37:37 +01:00
Benjamin Otte
26909ee913 textview: Simplify gtk_text_view_buffer_to_window_coords()
... and gtk_text_view_window_to_buffer_coords()
2017-11-11 05:25:22 +01:00
Benjamin Otte
2533ad723a textview: Use text_window_get_width()/height()
Instead of poking the GdkWindow. They have the same size after all.
2017-11-11 05:12:07 +01:00
Benjamin Otte
17600b6bab textview: Make the semi-private headrs really private
Rename the files to have the private.h ending.

And remove gtktextdisplay.h from the installed files.
2017-11-11 05:01:31 +01:00
Benjamin Otte
d18b10a3d7 textview: Store border window sizes in a custom struct
That way, we don't need to have a GtKRequisition in every TextWindow.
2017-11-11 04:30:00 +01:00
Benjamin Otte
d65d5d0a84 gtktexttag: Remove GtkTextTag::event and gtk_text_tag_event()
GtkSourceView is not using it, so it's unneeded. And it's certainly
diving deep into event internals of GtkTextView which hinders a proper
gesturization.
2017-11-11 04:25:11 +01:00
Benjamin Otte
52424d8640 textview: Hide the selection bubble better
The selection bubble is not part of the text windows, so hiding it
during scroll should not be done in the text window code.

Also remove an unused variable that was only set in that code but never
read.
2017-11-11 02:49:08 +01:00
Benjamin Otte
e9dd5f327f flowbox: Compute view box from correct variables 2017-11-11 02:49:08 +01:00
Matthias Clasen
12837f6905 Drop the last use of GDK_MULTIHEAD_SAFE
This define is not used anymore, this was a leftover.
2017-11-10 16:14:19 -05:00
Kjell Ahlstedt
b0d1ae4a5c GtkCssImageIconTheme: Don't try to unref a NULL pointer
In gtk_css_image_icon_theme_snapshot(), don't try to unref icon_info
if it's NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=790171
2017-11-10 16:48:30 +01:00
Benjamin Otte
1da8c1b27f rendericon: Add missing include 2017-11-10 15:04:13 +01:00
Benjamin Otte
5b94fe6342 stylecontext: Make first property name explicit
Insist that a first non-NULL property is passed to
gtk_style_context_get().

This is in particular relevant because of dropping the state argument
since GTK3, and code like
  gtk_style_context_get (context, state, "font", &font);
would keep compiling without warnings without this change.
2017-11-10 14:56:42 +01:00
Benjamin Otte
51c5ccf412 a11y: Report correct spinner size 2017-11-10 14:56:42 +01:00
Benjamin Otte
723bf44887 calendar: Fix for GTK4 changes 2017-11-10 14:56:42 +01:00
Matthias Clasen
2aa52c7d00 Simplify the gtk_snapshot_icon_texture API
Instead of passing the color matrix in from the outside,
just pass a boolean and set up the matrix internally.
2017-11-08 22:21:42 -05:00
Matthias Clasen
7aa236fbb2 Fix a compiler warning 2017-11-08 22:09:34 -05:00
Matthias Clasen
a381ee6a55 Fix a typo 2017-11-08 22:09:23 -05:00
Matthias Clasen
23162bf0de filesystem: Drop surface-based APIs
These are no longer used.
2017-11-08 21:56:28 -05:00
Matthias Clasen
8460034f58 filechooserwidget: Use GIcons
This lets us avoid much of the symbolic icon rendering api.
2017-11-08 21:56:28 -05:00
Matthias Clasen
9aba7e3aa7 filechooserbutton: Use GIcons
This lets use avoid much of the symbolic icon rendering api.
2017-11-08 21:56:28 -05:00
Matthias Clasen
4148795c8b filesystem: Add GIcon getters
We want to move away from surfaces, and instead pass
GIcons and GdkTextures around.
2017-11-08 21:56:28 -05:00
Matthias Clasen
c83665005a Use color matrices for -gtk-recolor
Use the same approach we take for recoloring in GtkIconHelper now.
As part of this change, GtkCsSImageRecolor is changed to not derive
from GtkCssImageUrl anymore.
2017-11-08 10:04:38 -05:00
Daniel Boles
6f54e1fc6d CssProvider: Fix doc of min theme version loaded
The code shows that we only load back to 4.0, but this still said 3.0.
2017-11-08 09:22:49 +00:00
Daniel Boles
6a9c14b2fa CssProvider: Use consistent theme name placeholder
commit 475d916eb9 added various paths that
use theme-name for this, but the existing path already used THEME, with
a subsequent description referring to the latter. So use that everywhere
2017-11-08 09:22:46 +00:00
Matthias Clasen
6e4f7ad857 Fix the build 2017-11-08 00:37:04 -05:00
Matthias Clasen
acf58063a7 css image: Use GdkTexture api directly
No need to load a pixbuf anymore, we can just
directly create textures.
2017-11-07 23:04:36 -05:00
Matthias Clasen
44a3f6bb41 css: Use a color matrix for recoloring -gtk-icontheme
This is the same approach we are already using in
GtkIconHelper.
2017-11-07 21:39:47 -05:00
Matthias Clasen
1da7dc890c Make the recoloring code more robust
Pass both width+height and scale, so we can handle the case
where width+height are zero and we are using the file, scaled.
2017-11-07 21:27:38 -05:00
Matthias Clasen
6ebd2d384b fix the build 2017-11-07 19:56:11 -05:00
Matthias Clasen
284fd36e5d Fix symbolic.svg rendering
With the shader approach to symbolic recoloring, we must
not recolor the svgs anymore as we're loading them. Instead,
load them the same way that gtk-encode-symbolic-svg does.

This fixes the rendering of large symbolic icons e.g. the
'no search results found' page in the file chooser.
2017-11-07 18:56:32 -05:00
Benjamin Otte
f80a90d39a widget: Don't leak the cursor on destruction 2017-11-06 03:28:34 +01:00
Piotr Drąg
08d5ed5875 placessidebar: correct quotation marks in a new string 2017-11-05 21:18:53 +01:00
Alexandru Pandelea
2421e745b9 placessidebar: add starred location item
Add an item for showing all files marked as favorite. This item will
open all files that have the nao:predefined-tag-favorite tag

https://bugzilla.gnome.org/show_bug.cgi?id=785176
2017-11-05 21:02:04 +01:00
Benjamin Otte
1cee71049a emojichooser: animate the adjustment
... instead of doing a dance with the scrolled window to get it to scroll
the adjustment.
2017-11-05 16:12:35 +01:00
Benjamin Otte
c4ecc0993a flowbox: Don't call get_allocation()
That's wome outdated workaround code from the last version of GTK3.
2017-11-05 14:46:01 +01:00
Benjamin Otte
73077c4e90 viewport: Implement clipping for picking
This is necessary because picking is no longer automatically constrained
to a widget's box. So all clipping widgets need to constrain their
clipping, too.

This patch does that for GtkViewport only.
2017-11-05 07:19:22 +01:00
Benjamin Otte
e8b2493680 aboutdialog: Clean up for logo being a texture 2017-11-05 06:50:28 +01:00
Benjamin Otte
22472c1924 entry: Remove surface icons
We have texture icons.
2017-11-05 06:45:01 +01:00
Benjamin Otte
0f5d807cae iconhelper: Don't render to surface anymore
Just go directly to texture.
2017-11-05 06:30:45 +01:00
Benjamin Otte
bc552e74d8 menubutton: Don't fiddle with prelight state 2017-11-05 05:13:17 +01:00
Benjamin Otte
4ee02725b4 themes: Do expander arrow :hover properly
We want to prelight the arrow even when the label is hovered.
2017-11-05 05:13:17 +01:00
Benjamin Otte
e3effc8df2 expander: Don't do :hover yourself
GTK does it for you.
2017-11-05 05:13:17 +01:00
Benjamin Otte
c4a9fa9865 range: Stop trying to be smarter than GTK
GTK deals with PRELIGHT properly itself now, so there's no need to try
do it manually.
2017-11-05 05:13:17 +01:00
Benjamin Otte
4bb9a6360f range: Use gtk_widget_pick() to pick the mouse location
That's rather unsuccessful so far because it requires skipping a bunch
of irrelevant widgets, but oh well...
2017-11-05 05:13:17 +01:00
Benjamin Otte
994287b71f widget: Make gtk_widget_pick() really slow
We cannot fast-track picking by using gtk_widget_contains(). Child
widgets may extend their parent using ie negative margins.

This is not just a theoretical concern, this is what's happening right
now with GtkScale's sliders relative to the trough.

The problem is that we now iterate through all widgets, even when they
aren't anywhere near the mouse pointer. So essentially every pick
operation is now guaranteed O(N_WIDGETS) which used to be the worst case
that pretty much never happened.
2017-11-05 05:13:17 +01:00
Benjamin Otte
cf1cd19b61 range: Stack widgets properly
The trough widgets have the slider on top of the fill level and the
hilight widget. Make sure the widget stacking respects that.

This is particularly relevant because picking event targets should pick
the slider and not the hilight widget.
2017-11-05 05:13:17 +01:00
Benjamin Otte
897fdaf1c0 entry: Texture properties are objects
Carelessly copy/pasting made them boxeds. Oops.
2017-11-05 05:13:17 +01:00
Benjamin Otte
cf2d549e92 widget: Implement gtk_widget_pick()
... and use it.
2017-11-05 05:13:17 +01:00
Benjamin Otte
8d849458ac docs: You can't modify textures
So there's no need to tell people they must not do that.
2017-11-05 00:07:17 +01:00
Benjamin Otte
70846c85b3 window: Make icons GdkTextures
Cairo surfaces are bad, mkay?
2017-11-05 00:07:17 +01:00
Benjamin Otte
b4b7c27274 aboutdialog: Make logo a texture property
Get rid of cairo surfaces!
2017-11-05 00:07:17 +01:00
Benjamin Otte
b12a53406d builder: Mirror GdkPixbuf abilities for GdkTexture
In particular, allow specifying a filename for a GDK_TYPE_TEXTURE
property. This makes it easy to transition properties from Pixbuf type
to Texture type without having to touch resource files.
2017-11-05 00:07:17 +01:00
Benjamin Otte
2d959553e9 image: Add the ability to set textures
This also adds it to all other places that use the same infrastructure:
GtkEntry and GtkCellRendererPixbuf
2017-11-05 00:07:17 +01:00
Emmanuele Bassi
481b5d1b89 Partially revert GskTexture → GdkTexture rename
Excessive use of sed when moving GskTexture to GDK; the GskTextureNode
should still live under the GSK namespace.
2017-11-04 15:06:00 +00:00
Benjamin Otte
c5a631b999 inspector: Unrealize renderer before unreffing
See previous patch for a description on why that is necessary.
`
2017-11-04 15:22:25 +01:00
Benjamin Otte
a0ff63e162 iconhelper: Compute surface size without icon helper
This is so we can do the next batch of changes
2017-11-04 15:22:25 +01:00
Benjamin Otte
197eeade74 textview: Use gtk_widget_set_cursor()
This currently breaks because we still use GdkWindows. Soon...
2017-11-04 15:22:25 +01:00
Benjamin Otte
f7646cf541 textview: Remove GdkWindow usage from the public API
A sideeffect is that we don't set the correct parent window on child
widgets anymore, but that is hopefully going to be fixed once we get rid
of child windows completely.
2017-11-04 15:22:25 +01:00
Benjamin Otte
a409320cda gtk: Use gtk_widget_set_cursor()
... and gtk_widget_set_cursor_from_name() instead of setting cursors on
GdkWindows.
2017-11-04 01:37:03 +01:00
Benjamin Otte
b38a4cb824 widget: Export gtk_widget_set_cursor()
Widgets can now set their favorite cursor using public API.

This is very necessary because all cursor-setting APIs are still
setting it on their GdkWindow, which by now is the toplevel - oops.
2017-11-04 01:00:27 +01:00
Benjamin Otte
9323d098a6 gdk: Cursors no longer have a display
Change constructors to reflect that.

While doing so, also add a fallback argument to the cursor constructors,
so it is now possible to create cursors with fallback.
2017-11-04 00:07:13 +01:00
Benjamin Otte
ca3c23662c GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
2017-11-04 00:07:13 +01:00
Carlos Garnacho
b8d3f88ddb gtkwindow: Use event target widget for WM handling special paths
The check used to achieve discarding events not meant for the window
widget itself (because they are handled in the regular paths). Using
the target widget is the equivalent now.
2017-11-03 22:19:13 +01:00
Kjell Ahlstedt
23014438d6 GtkWindow: Tidy up after icon became a cairo surface
Use g_value_set/get_boxed() in gtk_window_get/set_property(), case PROP_ICON.
icon_from_list() shall always add a reference to the returned icon.
gtk_window_set_icon() must accept icon != NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=789870
2017-11-03 20:05:28 +01:00
Timm Bäder
11b8f27b76 notebook: Fix setting show-tabs
show-tabs=FALS means the notebook is not supposed to show tabs,
regardless of whether it has a current page or not.
2017-11-03 11:22:44 +01:00
Timm Bäder
2603fa0cc3 notebook: Remove useless call to gtk_widget_reset_style 2017-11-03 11:22:44 +01:00
Timm Bäder
4f4ac29cd2 glarea: Use content size of the widget
For buffer sizes, etc. We only draw in the content area after all.
2017-11-03 10:47:02 +01:00
Timm Bäder
018daaeea8 rendernodeview: Use content size instead of allocated size 2017-11-03 10:47:02 +01:00
Timm Bäder
2283cbad92 colorplane: Use content size everywhere 2017-11-03 10:47:02 +01:00
Timm Bäder
34f3c6bd52 revealer: Create clip node for right widget size
It should use gtk_widget_get_width/height here to get the correct
content size of the revealer.
2017-11-03 10:47:02 +01:00
Benjamin Otte
f33c20920b x11: Add API to query root window and screen from GdkDisplay 2017-11-02 12:42:16 +01:00
Timm Bäder
8f55647fbb widget: Add get_width() and get_height() 2017-11-02 11:54:06 +01:00
Timm Bäder
dea8233663 widget: Remove stray prototype
gtk_cairo_transform_to_window is gone.
2017-11-02 11:25:41 +01:00
Matthias Clasen
fa5e3ee54e label: Stop using gdk_cursor_new_for_display
We prefer to use the name-based api for cursors nowadays.
2017-11-01 21:19:31 -04:00
Matthias Clasen
81cda3dcf7 Use x11-specific api to get at the screen
gdk_display_get_default_screen is going away.
2017-11-01 19:44:28 -04:00
Matthias Clasen
e41936c19c Fix a typo
A display is not of type GDK_TYPE_SCREEN.
2017-11-01 19:44:28 -04:00
Benjamin Otte
bd6b6ed93c gdk: Remove VisibilityNotify events 2017-11-01 22:00:34 +01:00
Benjamin Otte
c0ccad56f9 widget: Don't tell people to wait for nonexisting events 2017-11-01 22:00:34 +01:00
Daniel Boles
f24b286417 Adwaita: Fix Entry:has-frame if backdrop/disabled
by explicitly including these in the selector removing the border, to
avoid other rules on these pseudoclasses overriding the .flat class.

https://bugzilla.gnome.org/show_bug.cgi?id=789733
2017-11-01 20:24:56 +00:00
Daniel Boles
a58a5219b9 HighContrast: Fix GtkEntry:has-frame not working
• Remove the box-shadow at the top when the entry is in the foreground
• Bump precedence so that :disabled entries do not have .flat overridden
• Also add :backdrop to stop HCInverse getting a lighter BG in :backdrop

https://bugzilla.gnome.org/show_bug.cgi?id=789733
2017-11-01 20:24:55 +00:00
Daniel Boles
ff66de366c Inspector: better default split of CSS nodes/props
Move the default pos of the Paned handle to 400px from the left, i.e.
50% of the default width of the window. The previous position at 300px
from left meant the node treeview was too narrow & could easily result
in the (useful) State column not being visible in the case of many
apps. The properties pane doesn't need to be as big as it was anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=788898
2017-11-01 20:24:55 +00:00
Benjamin Otte
9d51134459 entry: Remove unused variable 2017-11-01 20:55:41 +01:00
Benjamin Otte
801d69017a switch: Use gtk_widget_contains() 2017-11-01 20:52:57 +01:00
Benjamin Otte
b6e0c9392a button: Use gtk_widget_contains() 2017-11-01 20:50:33 +01:00
Benjamin Otte
9b0d9aa7a6 wayland: Remove unused variable 2017-11-01 20:09:06 +01:00
Benjamin Otte
d88c441764 widget: Add gtk_widget_contains() 2017-11-01 19:46:59 +01:00
Matthias Clasen
606345cbaa Change the fullscreen-on-monitor api
Use GdkMonitor here, since that is our primary monitor
object now, and GdkScreen is going away.
2017-11-01 14:17:20 -04:00
Benjamin Otte
2d31a5499a gdk: Remove gdk_get_display_arg_name()
Since we're no longer allowing arguments, this is always NULL now.
2017-11-01 18:26:34 +01:00
Benjamin Otte
b880296354 window: Unset transient parent in set_display()
If somebody changes a window's display, the transient parent cannot
stay if it's on a different display.
2017-11-01 18:17:11 +01:00
Benjamin Otte
8059f9bb3a window: Clear the renderer un unrealize
We disconnect from the GDK window, so the renderer can't keep any useful
state.

Plus, we might be using an entirely different window next time we
realize (after a call to gtk_window_set_display() for example) that should
use a completely different renderer anyway.
2017-11-01 15:48:00 +01:00
Matthias Clasen
31b7555b7b Stop using screen resolution
This api is going away.
2017-10-31 18:53:29 -04:00
Matthias Clasen
a27bfaa0a3 Drop the GDK_DPI_SCALE variable
It complicates the dpi handling, and was really just a workaround
for non-dpi aware applications when hidpi support was first introduced.
2017-10-31 18:37:54 -04:00
Matthias Clasen
0cd88cd6b7 Stop using gdk_pango_get_context_for_display
The function does nothing useful for us.
2017-10-31 17:52:24 -04:00
Matthias Clasen
85e209a9c3 dnd: Remove remnants of screen tracking
There is only one screen nowadays, no need to track it.
2017-10-31 17:25:01 -04:00
Julian Sparber
2c42d8d6ed AboutDialog: Fix accepting GTK_LICENSE_AGPL_3_0
Add the ‘new’ GTK_LICENSE_AGPL_3_0 to the allowed enum range checked in
gtk_about_dialog_set_license_type(), so this value can actually be used.

https://bugzilla.gnome.org/show_bug.cgi?id=789678
2017-10-31 18:56:26 +00:00
Benjamin Otte
2740f5eeee inspector: Fix property being "display" now 2017-10-31 18:37:48 +01:00
Matthias Clasen
a3cffa5072 Drop GdkScreen from GdkDevice apis
Returning the screen does not add anything here and
GdkScreen is going away.
2017-10-31 12:30:38 -04:00
Matthias Clasen
f8cad19829 dnd: Drop GdkScreen from apis
Drop the screen argument from gdk_dnd_find_window_for_screen
and rename the function to gdk_dnd_find_window. The screen
argument does not add anything here since the drag context
is already tied to the display. Update all backends, and
update all callers.
2017-10-31 10:18:10 -04:00
Timm Bäder
c97e2af23b widget: Make invalidation coordinates widget-relative
Consider the coordinates passed to gtk_widget_queue_draw_region to be
relative to @widget's origin, not its parent. That implies passing
priv->allocation or priv->clip to _queue_draw_region of a widget means
using its parent as @widget.

This fixes GtkScrolledWindow overshoot invalidation, which assumed the
coordinates to be widget-relative and not parent-relative.
2017-10-31 10:10:53 +01:00
Timm Bäder
3dca25b6e4 textview: Remove {top,bottom,left,right}_border
These are now the same as the equivalent _margin values.
2017-10-31 10:10:53 +01:00
Timm Bäder
3c0657f0fd textview: Stop fiddling with CSS padding
This is done automatically now and doing it again here means we apply
the padding twice.
2017-10-31 10:10:53 +01:00
Timm Bäder
45c03a9263 widget: Rename color variable to match the color 2017-10-31 10:10:53 +01:00
Timm Bäder
23a1328fda viewport: Simplify child allocation
allocation->x and allocation->y are always 0
2017-10-31 10:10:53 +01:00
Timm Bäder
f576002e9e widget: Improve get_request_mode vfunc docs 2017-10-31 10:10:53 +01:00
Timm Bäder
099990fcbe gskpango: Remove GDK api macros
They only belong on public functions.
2017-10-31 10:10:53 +01:00
Benjamin Otte
3967072c66 docs: Fix up some places that still said screen instead of display 2017-10-31 08:25:37 +01:00
Benjamin Otte
ccd52a410e settings: Remove gtk_settings_get_for_screen()
All users of it are gone now.
2017-10-31 08:25:37 +01:00
Benjamin Otte
648d040395 widget: Remove gtk_widget_get_screen()
Replace the remaining users with "correct" code that does not need that
function anymore.
2017-10-31 08:25:37 +01:00
Benjamin Otte
4a43229d0b invisible: Make it use display, not screen 2017-10-31 08:25:37 +01:00
Benjamin Otte
b9504a547a mountoperation: Move from screen to display 2017-10-31 08:25:37 +01:00
Benjamin Otte
07164e098a window: Turn gtk_window_set_screen() into gtk_window_set_display()
And have a priv->display instead of a priv->screen.

Includes turning gtk_menu_set_screen() into gtk_menu_set_display(),
because that function just forwards to its window.
2017-10-31 08:25:37 +01:00
Benjamin Otte
941a621ea9 styleprovider: Fix fallout from merge
StyleProvider should inherit from GObject, not from itself.
2017-10-31 06:17:40 +01:00
Benjamin Otte
e8053622eb gtk: Fix debug build
It seems I didn't have debug builds enabled and forgot some
return_if_fail()s when doing the last patch.
2017-10-31 06:10:26 +01:00
Benjamin Otte
83fb7a649f css: Merge GtkStyleProviderPrivate into GtkStyleProvider
This is just lots of renaming.

The interface remains private, so the public API does not change, apart
from removing the definition of the Interface object to avoid
subclassing.
2017-10-31 04:33:54 +01:00
Benjamin Otte
c8986e66ce window: Remove gtk_window_get_screen()
It's identical to gtk_widget_get_screen(), just use that one.
2017-10-31 04:33:54 +01:00
Benjamin Otte
1c36c6ed4d widget: Remove gtk_widget_has_screen()
All widgets always have a screen (or display).
2017-10-31 04:33:11 +01:00
Matthias Clasen
c20d217d8f printoperation: Stop using gdk_app_launch_context_set_screen
It is not necessary.
2017-10-30 23:01:01 -04:00
Matthias Clasen
f63d01b782 gtk: Stop using gdk_event_get_screen
Use gdk_event_get_display instead.
2017-10-30 22:22:00 -04:00
Benjamin Otte
ecd5b399a4 icontheme: Use GdkDisplay instead of GdkScreen 2017-10-31 03:05:55 +01:00
Benjamin Otte
9151e0b9f5 stylecontext: Port to use display instead of screen 2017-10-31 03:05:54 +01:00
Benjamin Otte
cb0c7d6cf3 immulticontext: Remove unused variable 2017-10-31 00:44:35 +01:00
Benjamin Otte
44614394e6 widget: Turn screen-changed signal into display-changed 2017-10-31 00:43:11 +01:00
Benjamin Otte
59cfd56365 settings: Don't store the screen in the settings object
Screens are going away.

Code that still needs the screen just gets it from the display.
2017-10-31 00:42:32 +01:00
Matthias Clasen
9e5f4f94b3 immulticontext: Avoid GdkScreen api
No need for it here either.
2017-10-30 19:30:29 -04:00
Matthias Clasen
297889e080 immodule: Avoid GdkScreen api
Another place where it is not needed.
2017-10-30 19:27:36 -04:00
Matthias Clasen
24903e3fab modules: Avoid GdkScreen api
No need for this here either.
2017-10-30 19:19:38 -04:00
Matthias Clasen
0cd864283f assistant: Avoid GdkScreen api
There is no need at all here to use gtk_settings_get_for_screen.
2017-10-30 19:19:38 -04:00
Matthias Clasen
a1a5f556cb Some documentation updates
Document gtk_settings_get_for_display instead of for_screen.
2017-10-30 18:59:41 -04:00
Matthias Clasen
e821c2fc2f gtk: Avoid using gdk_screen_get_setting
We can get the setting from the display instead.
2017-10-30 16:51:20 -04:00
Matthias Clasen
f9cc7ca140 Add gtk_settings_get_for_display
This will help us avoiding screens in many places.
2017-10-30 16:50:14 -04:00
Matthias Clasen
a518072e87 Remove GdkScreen api usage
Use GdkDisplay equivalents where they exist.
2017-10-30 16:06:42 -04:00
Matthias Clasen
1f22c6532e Store the display inside GtkSettings
This is a step towards dropping GdkScreen.
2017-10-30 15:56:03 -04:00
Matthias Clasen
2926669a9b gtk: Stop handling settings events
We don't need this anymore, now that we use the ::setting-changed
signal.
2017-10-30 09:48:51 -04:00
Matthias Clasen
a8aff6ef8f gtk: Connect to GdkDisplay::setting-changed
We still handle the setting event, for now.
That will be removed in a future commit.
2017-10-30 09:29:54 -04:00
Benjamin Otte
916981f66e cssimagescaled: Remove now unused struct member 2017-10-30 02:55:46 +01:00
Benjamin Otte
481189867a inspector: Use the new monitor change signals
And on't use the GdkScreen anymore now that the GdkDisplay provides all
the information we care about.
2017-10-30 02:30:44 +01:00
Timm Bäder
91f40eb088 widget: Make parent property read-only 2017-10-29 18:03:10 +01:00
Timm Bäder
09239eb670 widget: Don't notify :parent when rearranging widgets
gtk_widget_reposition_after is also valid to call if the widget already
has a parent, so don't notify the parent property in that case.
2017-10-29 17:27:53 +01:00
Timm Bäder
ff6cd8f75e widget: Remove parent-set signal
When a widget unparents its child widget manually in finalize, this can
lead to the parent-set signal being emitted for those child widgets. The
parent already has a ref_count of 0 though, so it can't be used in a
meaningful way. Specifically, emitting the signal will already try to
ref the parent which prints a critical.

Since GtkWidget already has a "parent" property, one can use its notify
signal instead to get notified when the parent widget changes.
2017-10-29 17:24:12 +01:00
Timm Bäder
0be4166b89 inspector: Remove node != NULL check from recorder model
We use NULL to remove the selection.
2017-10-29 13:44:12 +01:00
Timm Bäder
8b0f60bb6f checkbutton: Destroy indicator widget when draw-indicator is FALSE 2017-10-29 13:27:03 +01:00
Benjamin Otte
457bd2b9ee cssimagescaled: Just return the computed image
... instead of returning either itself with uncomputed images or a
copy of itself with only one computed image and lots of other
uncomputed images that we're never gonna look at again.

This fixes expressions like -gtk-scaled(-gtk-recolor(...),-gtk-recolor(...))
which Adwaita uses for checkmarks and bullets.
2017-10-29 06:41:12 -04:00
Matthias Clasen
598d22d194 Avoid creating trivial shadow nodes
The Vulkan renderer creates a fallback surface for each shadow
node, even if we end up not rendering anything to it. Avoiding
this is a nice optimization.
2017-10-28 16:10:46 -04:00
Matthias Clasen
99d3d31314 Adwaita: Use scaled icons for checks and bullets
This gives us crip rendering on hidpi screens.
2017-10-28 15:22:54 -04:00
Matthias Clasen
1dbc50f3f8 Adwaita: Add scaled version of bullets and checks
We use these assets as .symbolic.png now, so for hidpi, we
should provide @2 variants.
2017-10-28 15:20:11 -04:00
Matthias Clasen
a48015d3c6 inspector: Show details for shadow nodes
One of the few node types that we're not detailing yet.
2017-10-28 14:30:03 -04:00
Matthias Clasen
dc0570cc17 gsk: Drop the GskRenderer::scale-factor property
This is can always be obtained from the window that is already
associated with the renderer, no need to maintain a separate
property for it.
2017-10-28 11:49:39 -04:00
Timm Bäder
50d9484083 Adwaita: Add back visible focus outlines for list rows 2017-10-28 11:46:35 +02:00
Timm Bäder
4dee08dd52 sizerequest: Don't pass uninitialized values to measure
The GtkWidgetClass::measure vfunc is not required to assign a value to
any of the (out) parameters, so we need to initialize the locals we pass
to it, otherwise we can end up with a garbage size request.
2017-10-28 11:42:08 +02:00
Federico Mena Quintero
559d32420c GtkPathBar: Centralize handling of outstanding cancellables
The path bar would crash if we disposed it before all pending I/O
operations had finished.  Now we remember all the outstanding
operations directly in the GtkPathBarPrivate, and deal with them
consistently.
2017-10-27 17:18:38 -05:00
Matthias Clasen
ea91ab1d99 gsk: Make text nodes more compact
The copy of the PangoGlyphString we do here was showing up
in some profiles. To avoid it, allocate the PangoGlyphInfo array
as part of the node itself. Update all callers to deal with
the slight api change required for this.
2017-10-27 17:13:40 -04:00
Simon McVittie
bdd2ca9a60 GtkHeaderBar: Reconsider buttons if any tiling state changes
Looking at the 1-bit "tiled or not?" state is not necessarily
enough.

Signed-off-by: Simon McVittie <smcv@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=789357
2017-10-27 12:14:44 -02:00
Drew DeVault
1b279e3d4a Wayland: Implement KDE's SSD protocol
If the compositor prefers server-side decorations and the client doesn't
customize the title bar, we disable client-side decorations and let the
compositor know. Otherwise, we continue to use client-side decorations.

Signed-off-by: Drew DeVault <sir@cmpwn.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781909
2017-10-26 15:51:56 -04:00
Florian Müllner
07beb6dba2 appchooserwidget: Don't limit application list unconditionally
As documented, GtkAppChooser is "typically [used] for the purpose of
opening a file". However given that applications that support neither
opening files nor URLs are filtered out, the chooser is not actual
useful for any other (atypical) usage. Change that by only applying
the filtering if a content-type was set, and use the full unfiltered
list otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=789327
2017-10-26 06:18:01 -04:00
Christian Persch
29d1cc2fcd actionable: Allow all detailed action name formats
Use g_action_parse_detailed_name() to enable use of this API
for actions with non-string parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=788841
2017-10-26 06:16:59 -04:00
Matthias Clasen
5bdc67f3f6 Drop gtk_cell_renderer_get_size
This function has been deprecated since 3.0, time to drop it.
2017-10-25 22:27:19 -04:00
Matthias Clasen
fb8589671d Drop unused includes of gtkrender.h
We don't use the gtk_render apis internally anymore.
Drop these includes so it is clear where the remaining
uses are.
2017-10-25 21:46:46 -04:00
Matthias Clasen
f8e74e8f04 Some minimal theme fixes for focus drawing
We don't want focus rectangles everywhere, so set them up
explicitly for the widgets where we want them, and only
if focus(visible) is set.
2017-10-25 18:35:32 -04:00
Matthias Clasen
46d4deeb1e Remove a shortcut in gtk_widget_set_focus_child
Since focus can now be represented by more than one state,
just looking at the focus_child is no longer sufficient - we
may fail to propagate :focus(visible) if we do so. For now,
just remove the shortcut and always do the work.
2017-10-25 18:26:06 -04:00
Matthias Clasen
0d4bd034c6 Always draw outline
We can now control with CSS where there the outline
is drawn.
2017-10-25 17:59:00 -04:00
Matthias Clasen
4209c1762d Support the new state in CSS selectors
Make :focus(visible) match the new state.
2017-10-25 17:59:00 -04:00
Matthias Clasen
8b15eabad2 Set the new state flag
For now, we only set the new visible focus state
on the focus widget, when we have visible focus.
Later on, we will allow setting it on other widgets.
2017-10-25 17:49:43 -04:00
Matthias Clasen
18b8a7f91f Add a state flag for visible focus
The new flag is called GTK_STATE_FLAGS_FOCUS_VISIBLE.
2017-10-25 17:49:43 -04:00
Timm Bäder
0d82de585c Adwaita: Remove focus outlines from scrollbars and scales
gtk3 didn't have focus outlines for these, so remove them for now.

Sorry lapo.
2017-10-25 09:34:52 +02:00
Chun-wei Fan
20fc576275 gtk/gtkcssenumvalue.c: Deal with __builtin_popcount on MSVC
__builtin_popcount is a GCCism that is used to count the number of bits
involved, which means any non GCC/CLang compilers won't like the code,
meaning that on MSVC builds we must implement it ourselves.

We first use __cpuid() to check whether the CPU supports the popcount
instruction, if it does, we use the __popcnt intrinsic, otherwise
(untested, since I don't have a system that does not have the
instruction), we use the suggested hacks at
http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:53:37 +08:00
Chun-wei Fan
a601e5d10e gtk/gtkwin32theme.c: Include gdk/gdkprivate.h
We still need to access the GdkEvent structure here directly, as using
the GdkEvent getters is likely not worth the trouble involved.

Please see Emmanuele's comment (#97) of the following bug URL.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:48:01 +08:00
Benjamin Otte
373b407bd2 Fix build
Don't do two things at once and forget to run ninja before pushing.
2017-10-24 18:26:08 +02:00
Benjamin Otte
8549e62d85 Add default return values to switch statements
We are using g_assert_not_reached() without doing anything, assuming it
aborts the program. In release builds however, it is ignored.
2017-10-24 18:21:03 +02:00
Matthias Clasen
6c74a8c755 inspector: Show more render node details
Should clip and container node details.
2017-10-24 15:24:23 +02:00
Alexander Larsson
96b04836d8 Drop all uses of GdkPixbufAnimation in the gtk APIs
These are basically animated gifs, and don't fit well in how
modern things animate.
2017-10-23 16:56:49 +02:00
Alexander Larsson
b1250935a0 GtkIconHelper: Remove unused code 2017-10-23 15:34:17 +02:00
Alexander Larsson
0089e4ad58 Drop pixbuf support in IconHelper and ImageDefinition
These are no longer used, instead we always covert to surface as
early as possible and drop the pixbuf.

This means we never store both the pixbuf and the surface at
for any longer time, which is wasteful. Also, its one step further
to drop GdkPixbufs from generic use in our APIs.
2017-10-23 15:28:33 +02:00
Alexander Larsson
61b2ab5d90 GtkDragSource: Don't use gtk_image_definition_new_pixbuf
We want to get rid of pixbuf image definitions.

Long term this should probably be gtk_drag_source_set_icon_surface instead.
2017-10-23 15:28:33 +02:00
Alexander Larsson
e205ae9fc1 CellRendererPixbuf: Never store pixbufs
Rather than store the pixbufs as themselves we immediately convert
them to surfaces. In the uncommon case that a pixbuf is read back
from the renderer we generate a new one from the surface data.
2017-10-23 15:28:33 +02:00
Alexander Larsson
2b194089dd GtkImage: Drop support for storing pixbufs
This drops the pixbuf property and the pixbuf getters. We keep
gtk_image_new/set_from_pixbuf, but these are small helpers that
immediately convert to a surface, and there is no way to later get
back the pixbuf you passed in.

The from file/resource codepaths are also changed to load a surface
instead of a pixbuf.
2017-10-23 15:28:33 +02:00
Timm Bäder
7ee2ab32b8 window: Use correct destroy notify for icon list
The list contains cairo_surface_t instances now, not GdkPixbuf anymore.
2017-10-23 14:43:47 +02:00
Timm Bäder
134ba2ebf7 icontheme: Silence some compiler warnings 2017-10-23 14:23:52 +02:00
Matthias Clasen
493f5d6b18 dnd: Add more surface apis
The new function, gtk_drag_source_set_icon_surface, is for setting
a drag source icon without using GdkPixbuf.
2017-10-23 14:16:31 +02:00
Alexander Larsson
d3fc937b4d GtkWindow/GdkWindow: Finish converting icons to surfaces
There were some parts left, for instance gdk_window_set_icon_list.
2017-10-23 13:45:25 +02:00
Alexander Larsson
6f8644ad25 GtkEntry: Use surfaces, not pixbufs for bitmapped icons 2017-10-23 13:45:25 +02:00
Alexander Larsson
7a0ce9804f aboutdialog: Use set_boxed on surface
cairo_surface_t is boxed, not a GObject.
2017-10-23 13:45:25 +02:00
Matthias Clasen
dfaed90f67 inspector: show color matrix node details
Show the matrix and the offset for color matrix nodes.
2017-10-23 11:47:23 +02:00
Matthias Clasen
a072f9fc06 Use a color matrix for symbolic icons
The recoloring of symbolic icons is just a color matrix
operation.
2017-10-23 11:47:17 +02:00
Matthias Clasen
e4cdbef092 Allow passing a color matrix when rendering icons
This will be used for symbolic icons.
Update all callers.
2017-10-23 11:44:52 +02:00
Matthias Clasen
b543257e42 icon helper: Use cached textures
Use a cached texture for themed icons if we can.
Currently, we only do this for non-symbolic icons.
2017-10-23 08:07:35 +02:00
Matthias Clasen
02db8ccd89 icon theme: Add a texture cache
Return cached textures for icons. This lets us avoid duplicate
texture uploads for icons whose surfaces we already cache.
2017-10-23 08:07:35 +02:00
Matthias Clasen
6c7d9c6445 recent manager: Remove dead code
These functions are no longer used.
2017-10-23 08:07:08 +02:00
Timm Bäder
f59e5b2b31 adwaita: Remove focus outlines from textviews 2017-10-23 07:58:07 +02:00
Matthias Clasen
8eea3e2ddd window: Correct the property definition for icon
cairo surfaces are boxed types, not objects.
2017-10-23 07:39:12 +02:00
Matthias Clasen
85503a8f95 about dialog: Correct the property definition for logo
cairo surfaces are boxed types, not objects.
2017-10-23 07:38:36 +02:00
Matthias Clasen
8b84df422b Drop gtk_recent_info_get_icon
We are moving away from pixbuf-based apis.
Use gtk_recent_info_get_gicon instead.
2017-10-23 06:21:59 +02:00
Matthias Clasen
b775238bc4 Document new clipboard apis
These are surface-based replacements for some pixbuf apis.
2017-10-23 05:58:54 +02:00
Matthias Clasen
65408a0b0c Document new selection apis
Document the new cairo surface-based apis for GtkSelection.
2017-10-23 05:58:54 +02:00
Matthias Clasen
50006c229f Drop gtk_drag_set_icon_pixbuf
We are moving away from GdkPixbuf in the api.
Use surface-based replacements instead.
2017-10-23 05:58:54 +02:00
Matthias Clasen
27e89c69cd selection: Add another surface api
Of course, we need a getter too.
2017-10-23 05:58:54 +02:00
Alexander Larsson
a4f7d0c0e0 GtkAboutDialog: Use surfaces for logo 2017-10-22 23:03:19 +02:00
Alexander Larsson
d22c91127f gtk_image_get_surface: Add docs 2017-10-22 22:57:55 +02:00
Alexander Larsson
aa873e7709 GtkWindow: Use cairo_surface_t for icons 2017-10-22 22:57:21 +02:00
Matthias Clasen
d8a4503c53 recent chooser: Don't use pixbuf based apis
Use gtk_drag_set_icon_surface here.
2017-10-22 22:23:01 +02:00
Matthias Clasen
6c57432e79 recent manager: always return a GIcon
Make gtk_recent_info_get_gicon return a useful GIcon in
all cases.
2017-10-22 22:22:55 +02:00
Matthias Clasen
ad00108678 selection: Add surface based apis
Add gtk_selection_data_set_surface.
2017-10-22 22:22:44 +02:00
Matthias Clasen
e5ce3144e0 image: Add surface based apis
Add gtk_image_get_surface.
2017-10-22 22:22:37 +02:00
Matthias Clasen
8f6fbc9c24 clipboard: Add surface apis
Add gtk_clipboard_set_surface and gtk_clipboard_wait_for_surface.
2017-10-22 22:22:31 +02:00
Timm Bäder
afea254526 overlay: Remove unused NULL-check 2017-10-20 15:12:28 +02:00
Timm Bäder
04c550bfb5 window: Make sure we query the window size before size-allocate'ing 2017-10-20 14:56:29 +02:00
Timm Bäder
09750f9937 renderborder: Don't snapshot all-invisible borders
If all of the borders have an alpha of 0, we don't need to snapshot
anything.
2017-10-20 14:56:29 +02:00
Timm Bäder
99026d2df8 renderbackground: Minimize style lookups
Move the early returns up so we don't look up all those css values for
no reason.
2017-10-20 14:56:29 +02:00
Timm Bäder
f5b0692cfc widget: Remove outdated comment on get_allocation
The allocation passed to gtk_widget_size_allocate can be retrieved these
days, using gtk_widget_get_allocated_size.
2017-10-20 14:55:53 +02:00
Matthias Clasen
55df74a102 window: Remove dead code
GtkWindow never has a parent widget, so we never need to create
a child window for it.
2017-10-20 14:43:11 +02:00
Matthias Clasen
04f6b26205 gsk: Tweak text node apis
Rename getters to follow the peek naming pattern.

Update all callers.
2017-10-20 13:54:01 +02:00
Matthias Clasen
243bd4f0c8 gsk: Tweak cairo node apis
Rename the surface getter to peek, following other render
node getters, and make the surface-based constructor private,
since it is not something we want to encourage.

Update all callers.
2017-10-20 13:54:01 +02:00
Emmanuele Bassi
95beabe4d6 build: Fix gtk_tools array expansion
The gtk_tools variable is an array of arrays; adding a new element
requires to maintain the same type, or we'll get a build failure when
we try to extract the newly added element.
2017-10-20 11:22:45 +01:00
Chun-wei Fan
18abb78bfd Meson: Support Windows builds
Add the necessary machinery into the Meson definition files so that we
can build for Windows.

Since we don't have Wayland or X support for our use case here, disable
them once we know that we are building for Windows, as they are
(otherwise) enabled by default, and enable the items that need to be
built for Windows builds.

Exclude gtk4-launch from Windows builds as that is something that
is not supported on Windows.

As we won't have gio-unix on Windows, and PangoFT2 is optional, don't use
fallbacks for them when we are on Windows (but do use fallbacks for
gio-win32, as it will be used).

Also, clean up meson.build a bit as we can just force-include
msvc_recommended_pragmas.h from GLib since we depend on GLib, and so we
can handle these warnings from msvc_recommended_pragmas.h instead.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-10-20 17:30:58 +08:00
Matthias Clasen
9c391e7a9f Optimize away trivial opacities
No need to go color matrix on an opacity of 0 or 1.
2017-10-19 12:08:39 +02:00
Debarshi Ray
7ee0e65631 GtkGestureZoom: Don't leak the list of sequences
https://bugzilla.gnome.org/show_bug.cgi?id=789149
2017-10-19 10:03:46 +02:00
Matthias Clasen
9da057568c Fix GtkStatusbarAccessible
GtkStatusbar is no longer a container, so GtkStatusbarAccessible
can no longer be a container accessible.
2017-10-18 17:30:20 +02:00
Matthias Clasen
3287469929 gtk: Stop using pixdata resources
It does not really help, and pixdata is deprecated.
2017-10-18 17:30:20 +02:00