Commit Graph

52567 Commits

Author SHA1 Message Date
Matthias Clasen
a0bbd14325 gsk: Scale glyphs in the glyph cache
Pass a scale factor when caching glyphs or looking them
up in the cache. The glyphs in the cache are rendered
with subpixel precision determined by the scale. Update
all callers to pass a scale factor according to the window
scale. This lets us render crisp glyphs on hidpi systems.
2017-10-28 13:13:31 -04:00
Matthias Clasen
6560961c59 vulkan: Handle changing window scale
The code that checks for the proper size of the our swapchain
was not taking window scale fully into account. With this change,
setting the window scale to 2 in the inspector causes the window
to grow and rendering to be scaled up as expected, with Vulkan,
in the same way it already is with cairo.
2017-10-28 11:57:53 -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
Emmanuele Bassi
02eb344950 x11: Query whether we have GLX support
Epoxy 1.4 has new ad hoc API that we can use to check whether GLX is
available on the current system.

If we didn't use this API, we'd have to manually dlopen libGL (or its
equivalent on different OSes) and check if it had GLX symbols; since
Epoxy already does all of this internally, we can simply ask it instead.

https://bugzilla.gnome.org/show_bug.cgi?id=775279
2017-10-28 09:46:15 -04:00
Emmanuele Bassi
183538c2e2 Bump up the dependency on libepoxy
We are going to use new API to detect whether or not GLX is available
before calling GL API.

https://bugzilla.gnome.org/show_bug.cgi?id=775279
2017-10-28 09:46:15 -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
Olivier Fourdan
999848e0c6 wayland: scale down reported monitor geometry
According to the documentation, gdk_monitor_get_geometry() reports the
monitor geometry in ”application pixels”, not in ”device pixels”,
meaning that the actual device resolution needs to be scaled down by the
scale factor of the output.

x11 backend does that downscaling, whereas Wayland backend did not,
causing a discrepancy depending on the backend used.

https://bugzilla.gnome.org/show_bug.cgi?id=783995
2017-10-27 16:01:38 -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
Olivier Fourdan
028e39d6ee wayland: Do not constrain saved window size
Under Wayland, an xdg_surface.configure with size 0x0 means it's up to
the client to set its size.

When transitioning from maximized state to un-maximized, the Wayland
compositor will send such an 0x0 configure so that the client can
restore its original size.

However, the original size was already constrained, so re-applying
size constrains can lead to a smaller size when using size increments.

Avoid this caveat by not applying size constrains when we are restoring
the original size.

https://bugzilla.gnome.org/show_bug.cgi?id=777072
2017-10-26 15:49:42 -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
Marek Kasik
fda120ceec printing: Install printbackends
Add "install : true" for each printbackend so that they are installed.

https://bugzilla.gnome.org/show_bug.cgi?id=789185
2017-10-26 09:49:13 +02:00
Matthias Clasen
db49d12fcf wayland: Don't spew warnings for blank cursors
We were unnecessarily spewing warnings when blank cursors
were getting a new scale set. Standardize on "none" as the
name for blank cursors, and avoid the warning.

https://bugzilla.gnome.org/show_bug.cgi?id=775217
2017-10-26 00:29:10 -04:00
Matthias Clasen
d2d8fb0528 icon-browser: Make non-symbolic icons visible again
The commit that added the scalable size to the details dialog
inadvertedly caused all icons to be hidden. No need to do that.
2017-10-25 23:58:09 -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
Andrea Azzarone
b6c41e57e2 gdk: Clear GL context when window is withdrawn
Some clients (e.g. gnome-online-accounts) quickly unmap and map
a window. With some backends the backend surface will be replaced
causing the application to crash because the GL context is still
using the old surface. Clearing the GL context when a window is
withdrawn fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=789141
2017-10-25 09:37:36 -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
5b9177f53b testsuite/gsk/test-render-nodes.c: Include <stdlib.h>
This is so that the compiler won't complain about our use of exit()

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:50:21 +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
Chun-wei Fan
006207e95e gdk/win32/gdkwindow-win32.c: Fix gdk_win32_window_set_icon_list()
The list of surfaces passed into the function may be NULL, so don't try
to initialize the surfaces if it is so, to avoid a crash.

Also, remove the cast to GdkPixbuf* for getting surfaces->data, as we
are already using a cairo_surface_t*.

https://bugzilla.gnome.org/show_bug?id=773299
2017-10-25 00:46:50 +08:00
Chun-wei Fan
a65730f38f modules/input/gtkimcontextime.c: Fix build
The GdkEvent structure became opaque, so we need to update the code so
that we use the getters and setters here.

https://bugzilla.gnome.org/show_bug?id=773299
2017-10-25 00:46:11 +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
Emmanuele Bassi
46f475664d Add a return value
When building with G_DISABLE_ASSERT, the g_assert_not_reached()
statement won't do anything, and we're going to fall through, and the
compiler will emit a warning that we're not returning anything from a
function with a return value.
2017-10-24 16:58:06 +01:00
Matthias Clasen
6c74a8c755 inspector: Show more render node details
Should clip and container node details.
2017-10-24 15:24:23 +02:00
Chun-wei Fan
4d44865f42 gdk/win32/gdkwindow-win32.c: Fix build
Make up for the missed commas...
2017-10-24 13:56:29 +08:00
Benjamin Otte
e1572e003a vulkan: No need to redefine gl_PerVertex
The compiler has those predefined, so use them.
2017-10-24 01:29:28 +02:00
Benjamin Otte
e4dbff6bfc vulkan: Delete unused shaders
These have been renamed to .frag/.vert, apparently the originals weren't
deleted.
2017-10-24 01:29:28 +02:00
Matthias Clasen
4f6cee3ee3 Mention pixbufs in the migration guide
They are being phased out.
2017-10-23 18:33:15 +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
Benjamin Otte
3a8f2ae64f build: Warn about ignored qualifiers
https://bugzilla.gnome.org/show_bug.cgi?id=789351
2017-10-23 16:30:57 +02:00
Emmanuele Bassi
dd4c800542 Remove unnecessary const
We return a scalar value, so we don't need it to be constant.

https://bugzilla.gnome.org/show_bug.cgi?id=789351
2017-10-23 15:23:09 +01: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