Commit Graph

41620 Commits

Author SHA1 Message Date
Emmanuele Bassi
fa90052299 gl: Add context options
Users of the GdkGLContext API should be allowed to set properties on the
shim GdkGLContext instance prior to realization, so that the
backend-specific implementation can use the value of those properties
when creating the windowing system specific resources.

The main three options are:

 • a major/minor version tuple, to request a specific GL version
 • a debug bit, to request a "debug context", which provides additional
   validation and run time checking
 • a forward compatibility bit, to request a context that does not
   have deprecated functionality

See also:
 - https://www.opengl.org/registry/specs/ARB/glx_create_context.txt

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:05 +00:00
Emmanuele Bassi
22e6f37c9c GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.

We have a couple of requirements in terms of API:

 • avoid, if at all possible, the "C arrays of integers with
   attribute, value pairs", which are hard to write and hard
   to bind in non-C languages.
 • allow failing in a recoverable way.
 • do not make the GL context creation API a mess of arguments.

Looking at prior art, it seems that a common pattern is to split the
construction phase in two:

 • a first phase that creates a GL context wrapper object and
   does preliminary checks on the environment.
 • a second phase that creates the backend-specific GL object.

We adopted a similar pattern:

 • gdk_window_create_gl_context() creates a GdkGLContext
 • gdk_gl_context_realize() creates the underlying resources

Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:04 +00:00
Stas Solovey
8f50148a34 Updated Russian translation 2015-02-08 22:14:05 +00:00
Kjartan Maraas
614556180a Updated Norwegian bokmål translation 2015-02-08 19:34:46 +01:00
Piotr Drąg
87480d7d1c Updated POTFILES.skip 2015-02-07 17:06:58 +01:00
Benjamin Otte
1116914ea0 css: Move scale to GtkStyleProviderPrivate
This way, we can remove it as a separate argument from
gtk_css_value_compute() and allow computation to only depend on one
thing: the style provider.
2015-02-06 11:26:31 +01:00
Benjamin Otte
808bfe0a98 settings: Provide a default style cascade per scale
This guarantees we only create 1 extra style cascade in total for hidpi
and not one per style context.

Style cascades are now nested like this:

GtkSettings root cascade (scale == 1)
 |
 +-- GtkSettings per scale cascade (for any scale, no custom providers)
 |
 +-- GtkStyleContext custom cascade (for any scale, custom providers)

This requires a bunch of care when changing cascade-related properties
inside GtkStyleContext, so that it ends up with a properly setup
cascade, but I think I got those cases right.

The only thing we don't do yet is reverting to a GtkSettings cascade
when the last custom provider is removed from a custom cascade.
2015-02-06 11:26:31 +01:00
Benjamin Otte
9209c4ea41 stylecontext: Store the scale value in the cascade
This is in preparation for the next commits.
2015-02-06 11:26:31 +01:00
Chun-wei Fan
0b06b1e3f7 gdkglcontext-win32.h: Clean Up a Bit
We don't have a Win32-specific ->upload_texture() anymore, so don't
indicate so.  Left out this part from my previous commit.
2015-02-06 13:00:59 +08:00
Chun-wei Fan
24e6bda264 GDK-Win32: Drop Win32-specific ->upload_texture()
The default ->upload_texture() works also for Windows since commit 27cf0fa,
as some of the problems described in 742953 also applied for GL core
contexts on Windows as well before 27cf0fa.  Clean up the GDK-Win32 code a
little bit as a result.
2015-02-06 12:41:38 +08:00
Benjamin Otte
93c3b90f6a treeview: Fix copy/paste bug
Introduced in 7eecb16404
2015-02-06 03:13:59 +01:00
Benjamin Otte
89f635fee1 css: Add -gtk-dpi CSS property hack
This property is necessary to ensure widgets automatically update after
the text scale factor is changed desktop-wide.

And if I'm already doing a property like this, I can make it
overridable. So now you can override the dpi per-widget with CSS like
GtkSwitch {
  -gtk-dpi: 48;
}
if you want to debug things.

Long-term, we want to get rid of this property and insist on dpi being
96 everywhere and people can change the font size to get larger fonts.
2015-02-05 18:57:29 +01:00
Benjamin Otte
7eecb16404 treeview: Don't create an overly large pixel cache
GPUs generally have problems when you create a 35000px wide surface.
Luckily X catches this and sends a BadAlloc. Which GTK immediately
abort()s on.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1163579
2015-02-05 18:57:29 +01:00
Benjamin Otte
98ee594f73 blur: Simplify return_if_fail() 2015-02-05 18:57:29 +01:00
William Hua
0a64a4f3c0 mir: release surface before rendering parent
We should remove the mir and cairo surface before rendering the
transient_for, which will regenerate the cairo surface anyways.
Otherwise, we end up releasing both, when we only really want to get rid
of the mir surface.
2015-02-05 17:26:19 +01:00
William Hua
85c5f6058a mir: don't always request mir surfaces
Some child window behaviour is faked by painting in the parent, so we
don't bother creating the Mir surface in that case.
2015-02-05 17:26:19 +01:00
William Hua
bee39d2251 mir: reconstruct surface if window is moved 2015-02-05 17:26:19 +01:00
William Hua
16b250f9bb mir: stop using deprecated surface api 2015-02-05 17:26:19 +01:00
William Hua
5eacc92ba7 mir: fix issues with mouse over parent menu
Mouse over a parent menu[bar] didn't work while the menu was open.
The fix was to correct the behaviour of pointer crossing events so that
the pointer appears to be only inside one window at a time.

See: http://tronche.com/gui/x/xlib/events/window-entry-exit/normal.html
2015-02-05 17:26:19 +01:00
William Hua
6a3904cf0c mir: add back window hierarchy functions 2015-02-05 17:26:19 +01:00
William Hua
c2afa674e2 mir: stop forwarding motion events to subwindows 2015-02-05 17:26:19 +01:00
William Hua
901bc2957d mir: generate leave events for transient children 2015-02-05 17:26:19 +01:00
Marco Trevisan (Treviño)
737e598a17 mir: use monitor plug names more similar to the ones used in Xmir 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
9a84c3e0f5 mir: only paint background if window has one 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
38d46aacae mir: use old scrolling system if we get simple integer values 2015-02-05 17:26:18 +01:00
William Hua
584cfff90a mir: end the current grab on ungrab 2015-02-05 17:26:18 +01:00
William Hua
e843d94405 mir: only render non-top-level transients. 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
9abf990656 mir: handle new MirCloseSurfaceEvent 2015-02-05 17:26:18 +01:00
William Hua
5ac5f6f81a mir: reset cursor_inside on hide/withdraw
Without this, we generate incorrect crossing events for transient
windows.
2015-02-05 17:26:18 +01:00
William Hua
8e0abb4bac mir: disable some debug output 2015-02-05 17:26:18 +01:00
William Hua
4f19be1c82 mir: skip windows that aren't visible 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
05de5b02cb mir: fix IsModifierKey definition 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
345140008e mir: check the log events env variable just once 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
7e5b216511 mir: set event source device as well 2015-02-05 17:26:18 +01:00
William Hua
7c2e3a812a mir: fix time conversion macro 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
54f9263f19 mir: implement stub _gdk_mir_keymap_key_is_modifier
Using IsModifierKey for now
2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
a8b1e81816 mir: check (using simple keycode checking) if we're handling a modifier key 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
9e2eb5d2f6 mir: compute the modifiers using the saved button_state on key events 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
7d4066de41 mir: add a NANO_TO_MILLI conversion macro 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
6b6af59b9b mir: properly converts mir nanoseconds timestamps to milliseconds 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
cb19fd50cb mir: use actual events time 2015-02-05 17:26:17 +01:00
William Hua
948afc68f6 mir: add timestamps to generated GdkEvents
We need this because it fixes menu activation. The menu activation code
looks at the time between events to determine if mouse clicks happen too
quickly.
2015-02-05 17:26:17 +01:00
William Hua
f1cfd23cd2 mir: pass motion events down to transient children 2015-02-05 17:26:17 +01:00
William Hua
e2320678ae mir: use parent_window's impl for GDK_INPUT_ONLY windows
Fixes a crash that occurs when the user selects text.
2015-02-05 17:26:17 +01:00
Carlos Garnacho
6b82ad48f6 scrolledwindow: Don't hover the scrollbars while a button is being pressed
This avoids showing the scrollbars if we are positive the child widget
is being manipulated, regardless of the pointer being close to any of these.
On the next motion event after finishing the operation, the scrollbar will
be shown if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=743894
2015-02-05 17:24:29 +01:00
Carlos Garnacho
4ba2c9ad87 popover: Unset the grab when the popover loses its parent
This ensures the grab and signal handlers are removed if the parent goes
NULL.
2015-02-05 15:09:51 +01:00
Carlos Garnacho
d053db289e window: Unparent popover before unmapping/unrealizing
Otherwise spurious invariants warnings may happen before the popover
is removed from the window.
2015-02-05 15:09:35 +01:00
Carlos Garnacho
cc511268a0 window: call gtk_widget_unmap() on popover widgets unconditionally
is_visible() wasn't the right check to perform here before unmapping,
and gtk_widget_unmap() already avoids being doubly called by checking
gtk_widget_get_mapped() anyway.
2015-02-05 15:09:28 +01:00
Carlos Garnacho
5837c1c710 popover: Keep a ref on the parent scrollable
This ensures the scrollable is still alive on dispose(), and properly unset
after disconnecting all signal handlers.
2015-02-05 15:08:12 +01:00
Matthias Clasen
b15193943a GtkStatusIcon: Expand deprecation docs
https://bugzilla.gnome.org/show_bug.cgi?id=743975
2015-02-05 10:42:57 +01:00