Commit Graph

6249 Commits

Author SHA1 Message Date
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
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
6f07d5e761 x11: Detect libinput touchpads
These aren't reported as XIDependentTouch devices, so make it poke a
property that's specific to touchpads managed by the libinput driver.
2015-02-02 13:55:38 +01:00
Víctor Manuel Jáquez Leal
64f26db038 gtkx: add missing header
The header file gdk/x11/gdkx-autocleanups.h is not installed, but
it is required by gdkx.h

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 13:47:06 +01:00
Alexander Larsson
a71ff33266 gdk: Add support for g_autoptr()
https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 09:28:22 +01:00
Matthias Clasen
31d3be96e4 Be safe against stray booleans
Since gboolean is a typedef for int, the compiler won't complain
about gdk_window_set_event_compression (w, 2). So, make it work.

https://bugzilla.gnome.org/show_bug.cgi?id=742566
2015-02-01 17:30:10 -05:00
Matthias Clasen
561ff51abb Fix an oversight
Commit ff256956b2 introduced a frame_clock_events_paused
flag, but only ever set it to TRUE, instead of unsetting it when
events are resumed. This was leading to assertion failures in
_gdk_display_unpause_events().
2015-01-30 18:42:06 -05:00
Tom Hughes
ff256956b2 Resume events when disconnecting from a frame clock
If we are disconnecting from a frame clock that has paused event
processing and hasn't issued a resume yet make sure we resume the
events or they will stay blocked forever.

https://bugzilla.gnome.org/show_bug.cgi?id=742636
2015-01-30 17:32:58 -05:00
Carlos Garnacho
ea983404ec win32: Don't check the position of a NULL device
This function is given a barely setup GdkEvent, so the GdkDevice field
is still unset, causing warnings and misbehaviors when the position
is queried for it.

Given that the wintab GTK+ code seems to rely somewhat hard on the wintab
device managing the pointer cursor, query the pointer position from the
pointer itself.

https://bugzilla.gnome.org/show_bug.cgi?id=743330
2015-01-28 16:59:29 +00:00
Carlos Garnacho
1543890569 win32: Ensure we can create a window for wintab
The window used NULL as a parent window, which defaults internally to
using the root window of the default screen. But at the time wintab is
initialized, there is no default display/screen yet.

Fix this by retrieving this information from the given GdkDeviceManager,
so we don't have to wait for the display to be in place before
initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=743330
2015-01-28 16:59:29 +00:00
Rui Matos
2dd07f346a gdkscreen-wayland: Don't leak wl_output objects
https://bugzilla.gnome.org/show_bug.cgi?id=743633
2015-01-28 17:17:09 +01:00
Niels Nesse
00834786be GDK GL context's should associate with "window->impl_window" not "window"
In some layouts this inconsistency results in crashes in
gdk_gl_texture_from_surface() since it uses gdk_gl_context_get_window() but
the returned window is not the same as the one that is being painted so
"window->current_paint.surface" is NULL. I saw this problem when packing a
GdkGLArea into a GtkPaned.

https://bugzilla.gnome.org/show_bug.cgi?id=743146
2015-01-28 12:00:30 +00:00
Niels Nesse
27cf0fa34c Fix core context creation in GdkGLContext
- Specifically request GL version when creating context. Just specifying core
profile bit results in the requested version defaulting to 1.0 which causes
the core profile bit to be ignored and an arbitrary compatability context to be
returned.

- Fix GL painting by removing GL calls that have been depricated by the 3.2 core
profile.

- Additionally remove glInvalidateFramebuffer() call, it is not supported by 3.2
core.

https://bugzilla.gnome.org/show_bug.cgi?id=742953
2015-01-28 12:00:30 +00:00
Matthias Clasen
5fc8cf4331 x11: Handle obsolete selection requests without crashing
The ICCCM says:

If the specified property is None, the requestor is an obsolete client.
Owners are encouraged to support these clients by using the specified
target atom as the property name to be used for the reply.

Lets do that, instead of crashing.

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

The previous fix for this issue in 732af31424 was incomplete.
2015-01-24 19:32:52 -05:00
Matthias Clasen
95fad690d2 wayland: Don't claim to support selection notification
We don't support selection notification, so don't claim
we do, only to fail later.

https://bugzilla.gnome.org/show_bug.cgi?id=743229
2015-01-24 17:25:43 -05:00
Matthias Clasen
b6551c84c9 Initialize variables
No need to risk valgrind complaints about initialized
values.

https://bugzilla.gnome.org/show_bug.cgi?id=743422
2015-01-24 16:45:04 -05:00
Carlos Garnacho
121fddc4d2 x11: Fetch vendor/product identifiers for input devices
These are retrieved from XInput device properties.

https://bugzilla.gnome.org/show_bug.cgi?id=740758
2015-01-19 15:09:19 +01:00
Carlos Garnacho
5e53676b46 device: Add property/getters for vendor/product identifiers
These are a construct only properties, expected to be filled in from
platform specific code.

https://bugzilla.gnome.org/show_bug.cgi?id=740758
2015-01-19 15:09:19 +01:00
Matthias Clasen
47e5e1c72d Fix a typo in the docs
https://bugzilla.gnome.org/show_bug.cgi?id=743037
2015-01-18 15:26:49 -05:00
Matthias Clasen
9c1063f602 broadway: Only use abstract sockets when they are supported
GIO has a function to check whether abstract sockets are
supported, so use it. This should make broadway work on
Freebsd again.

https://bugzilla.gnome.org/show_bug.cgi?id=742980
2015-01-18 15:24:30 -05:00
Matthias Clasen
811d602842 Make Broadway work on freebsd
It seems that posix_fallocate gives an ENODEV error when
called on an fd opened with shm_open on freebsd. Fix up
the error check to only trigger if we get ENOSPC.

https://bugzilla.gnome.org/show_bug.cgi?id=742980
2015-01-18 15:15:37 -05:00
Matthias Clasen
cf277fabb5 Remove some outdated references
We shouldn't recommend gtk_widget_modify_bg() or
gtk_style_set_background() anymore.
2015-01-18 12:41:07 -05:00
Maks Naumov
6113504495 Fix event->button.y_root when using mouse buttons and dnd canceled
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742785
2015-01-17 16:29:17 -05:00
Matthias Clasen
48865fb9d9 Prefer the Wayland backend
This does not affect X11 sessions, but has the advantage that
we get much more testing of the Wayland backend in Wayland
sessions.
2015-01-17 01:03:10 -05:00
Maks Naumov
430ea2fff6 Properly ignore BadWindow and BadDrawable in get_child_info_handler()
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742771
2015-01-11 14:33:10 -05:00
Emmanuele Bassi
a834078804 x11/gl: Do not specify the GLX context version
If we use GDK_GL_PROFILE_3_2_CORE we are asking for a core profile
according to the GLX_ARB_create_context_profile extension. For that,
we pass the GLX_CONTEXT_CORE_PROFILE_BIT_ARB value for the
GLX_CONTEXT_PROFILE_MASK_ARB attribute.

The specification for the extension says that:

  If the requested OpenGL version is less than 3.2,
  GLX_CONTEXT_PROFILE_MASK_ARB is ignored and the functionality
  of the context is determined solely by the requested version.

Since we're asking for a core profile, we assume a GL version greater
than or equal to 3.2; thus, we don't need to specify the
GLX_CONTEXT_MAJOR_VERSION_ARB or the GLX_CONTEXT_MINOR_VERSION_ARB
attributes, and instead just rely on whatever version GLX gives us.

This seems to work around a strange issue in Mesa; if we ask for a core
profile and any version > 3.0, we get broken rendering on any shared
context we create.
2015-01-10 00:07:51 +00:00
Jasper St. Pierre
ecc64f63e4 gdkeventsource-wayland: Fix style 2014-12-28 18:13:34 -08:00
Rico Tzschichholz
07efae7288 mir: Add missing reference to gdkmir-private.h 2014-12-28 13:34:16 +01:00
Emmanuele Bassi
5d42c55f28 x11/gl: Set the correct minor version
The major version is set twice.

https://bugzilla.gnome.org/show_bug.cgi?id=741954
2014-12-25 11:49:58 +00:00
Philip Chimento
ec37fbe2e2 quartz: NSWindow NULL check in get_scale_factor
Sending backingScaleFactor to a NULL NSWindow will silently give the
value 0 for the scale factor, causing insidious divide-by-zero bugs down
the line. This checks if the NSWindow is NULL first, as seems to happen
throughout the rest of the file.

Note that I don't have a hi-DPI OS X machine to test this on, though.

https://bugzilla.gnome.org/show_bug.cgi?id=738338
2014-12-24 14:57:40 -08:00
Chun-wei Fan
36245b7058 GDK-Win32: Drop Some Unused Items
There were a bit of unused items from the GDK-Win32 work on GL support, so
drop them.
2014-12-22 11:25:49 +08:00
Matthias Clasen
1dbc6d91f0 Don't initialize GL if it has been disabled
We've observed hangs of mutter when it initializes GTK+, which
are caused by initializing GL, which in turn makes xwayland
call back into mutter. With this change, mutter should just
disable GL support in GDK, and things will work.
2014-12-19 12:27:31 -05:00
Matthias Clasen
57d034ce9f Add an XSetting for the session bus ID
This will allow us to identify situations where we are not on
the same session bus as the xsettings provider.

https://bugzilla.gnome.org/show_bug.cgi?id=671802
2014-12-18 23:26:11 -05:00
Chun-wei Fan
536fa88cd8 Add OpenGL Support for the GDK Windows Backend
This adds support for OpenGL to the GDK Windows backend using the WGL API
calls, which enables programs that uses the GTK+ GLArea widgets to work on
Windows as well.

This also adds a simple utility function to query for the version of OpenGL
that is supported by the Windows system, like the one provided by the X11
backend.

Many thanks to Alex (and Emmanuele, who started the OpenGL integration in
GTK+) who offered advice and help along the way, as well as the X11 and
Wayland backend for this work to refer to and to model upon.

https://bugzilla.gnome.org/show_bug.cgi?id=740795
2014-12-17 16:07:02 +08:00
Chun-wei Fan
9fd9f61b00 gdkgl: Use vfunc For Uploading Textures
As the alignments, strides and image formats may be different across
platforms, make the texture upload a vfunc to allow backends to override
the GL commands for uploading textures for the software implementation for
gdk_gl_texture_from_surface(), if necessary.

Suggested by Alex to avoid copying non-trivial portions of code which would
then add maintainenace burden.

https://bugzilla.gnome.org/show_bug.cgi?id=740795
2014-12-17 16:06:25 +08:00
Alexander Larsson
a1a01983f7 gdk: Fix scissoring with scaled windows
Make sure the window scale is always taken into acount when setting up
the scissor regions.
2014-12-15 22:31:48 +01:00
Alexander Larsson
2693496b56 gdk_gl_texture_from_surface - fix software fallback
We can't combine multiple draws into one for the software fallback,
because each quad has a different texture. And we generally don't
want to make a larger single texture because then we would have
to upload more data.
2014-12-15 21:57:02 +01:00
Alexander Larsson
4a4125bcfc gdk_cairo_draw_from_gl - fix drawing with alpha on window scale > 1
The scissoring needs to take into account the window scale.
2014-12-15 21:57:02 +01:00
Michael Natterer
c00cc269c5 broadway: Initial SSL support
Use the new --cert and --key parameters to broadwayd to pass paths to
cert and key files.

https://bugzilla.gnome.org/show_bug.cgi?id=730364
2014-12-15 11:25:43 +00:00
Jasper St. Pierre
4c0b2087c6 gdk: Emit stamp-gc-h in the correct directory 2014-12-12 17:32:02 -08:00
Matthias Clasen
4f96353964 Fix some oversights with header guards
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741254
2014-12-08 19:31:56 -05:00
Marco Trevisan (Treviño)
af2ac29faf gdkgl: pass the correct number of quads to gdk_gl_texture_quads
And call it only if that's the case
2014-12-02 14:59:47 +01:00
Marco Trevisan (Treviño)
cf64f8a76a mir: don't initialize the display if the required pixel formats aren't available 2014-12-01 18:05:30 +01:00
Matthias Clasen
bae4450698 Quiet some make rules 2014-11-30 17:18:54 -05:00
Matthias Clasen
c304f2ea68 docs: Add a missing word 2014-11-28 14:25:42 -05:00
Marco Trevisan (Treviño)
b8925253b6 mir: clear screen, keymap and event source when disposing dpy 2014-11-27 19:25:55 +01:00
Matthias Clasen
732af31424 x11: Handle obsolete selection requests without crashing
The ICCCM says:

If the specified property is None , the requestor is an obsolete client.
Owners are encouraged to support these clients by using the specified
target atom as the property name to be used for the reply.

Lets do that, instead of crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=740613
2014-11-26 22:27:49 -05:00
Jasper St. Pierre
fe8f6f60dc gdkdisplay-x11: Don't do extra work when simply moving the window
We shouldn't bother recalculating all the visible regions and wiping
away the old updating areas if we're simply dragging the window around.
2014-11-26 17:14:53 -08:00
Matthias Clasen
c1ca7986ee Make scale=2 work again
There was a leftover HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE ifdef
that broke things, now that we don't use this define anymore.
2014-11-24 10:02:54 -05:00
Chun-wei Fan
16e863ce65 gdkgl.c: Avoid GCCism in Pointer Arithmetic
NULL-plus-something could be seen by the compiler to attempt to do
arithmetic with void *, which is a GCCism.  Instead, do the math normally
and cast the results as a void *.

https://bugzilla.gnome.org/show_bug.cgi?id=740605
2014-11-24 22:57:25 +08:00
Carlos Garnacho
44c412ecc7 wayland: Pass shadow width to the compositor
Use xdg_surface_set_window_geometry() to tell the compositor about the
shadow widths, this makes some gnome-shell/mutter features (edge resistance,
frames around windows in the overview, side maximization, ...) work alright
with GTK+.

In order to add this, some other places in gdkwindow-wayland had to gain
some knowledge about margins:

- xdg_surface_configure() now syncs the shadow after applying the state,
  and gdk_wayland_window_set_shadow_width() possibly reconfigures the
  window in order to preserve window geometry. This is necessary to keep
  shadows in sync with state/geometry changes, as this does not happen
  all at once.
- xdg_popups relative to an xdg_surface are shown relative to buffer
  coordinates, so the left/top margins must be added there.

https://bugzilla.gnome.org/show_bug.cgi?id=736742
2014-11-23 13:11:08 +01:00
Jasper St. Pierre
10a7a89311 gdkinternals: Document our drawing and painting process better 2014-11-22 11:46:53 -08:00
Jasper St. Pierre
c01e37a9a5 gdkgl: Texture quads in one giant draw call
This requires us to use GL_TRIANGLES and six verts per quad instead
of four, which makes me think it might not be worth it on
well-optimized GL drivers. However, from talking to some driver
developers about it, the GL_TRIANGLES should be faster, since this
means that there's one giant contiguous buffer instead of many small
buffers.

If we were really rendering a lot of quads, I'd use an element buffer
and GL_PRIMITIVE_RESTART, but we're really not ever rendering that
many quads, and the setup cost for that would just be too annoying.
2014-11-22 10:34:47 -08:00
Jasper St. Pierre
6ffba866a6 gdkgl: Use one VBO for both position and uv attributes 2014-11-22 10:17:43 -08:00
Jasper St. Pierre
37ad6e1147 gdkgl: Texture many quads at once for performance reasons
This isn't fully performant yet. To be fully performant, we'd need to
do everything in one giant buffer.
2014-11-22 10:13:58 -08:00
Jasper St. Pierre
7312c01f62 gdkglcontext-x11: Make sure to enable the scissor test 2014-11-22 10:01:51 -08:00
Jasper St. Pierre
37697f1817 gdkgl: Use a GdkTexturedQuad struct to paint quads
We'll soon have a new function that paints multiple quads.
2014-11-22 09:40:10 -08:00
Jasper St. Pierre
28846536cb gdkgl: Clean up program-manipulating code
Abstract the program ID and locations into a "program struct" which
we then use.
2014-11-22 09:29:27 -08:00
Jasper St. Pierre
3f0c84f7ad gdkwindow: Clean up whitespace slightly
This has been bothering me for a while.
2014-11-22 08:12:22 -08:00
Jasper St. Pierre
8976e84ded gdkwindow: Don't pass the region to the impl when beginning a paint
It's unused. At the same time, rename "begin_paint_region" to
"begin_paint". This will help us clean up how GDK painting works
in the future to allow more creative use of double-buffering.
2014-11-22 08:08:34 -08:00
Jasper St. Pierre
ec2925a5bf quartz: Don't bother storing the paint_clip_region
It's unused.
2014-11-22 08:07:28 -08:00
Marco Trevisan (Treviño)
1730bb0e81 mir: initialize surface name with program name 2014-11-21 04:46:47 +01:00
Alexander Larsson
442adf6359 GL: Fix typo in gdk_gl_texture_from_surface
Got a sign wrong in commit 800c712738
2014-11-20 15:37:40 +01:00
Alexander Larsson
cf94da2ca1 GdkGLContext: Remove unused update vfunc
The update virtual function for GdkGLContext is unused and is a
leftover from a previous GL approach. Just remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
2014-11-20 12:38:04 +01:00
Alexander Larsson
800c712738 GL: Fix GL Y coordinate flipping to use unscaled window height
This is needed in the edge case where the X11 backend rounded the actual
size, and the GL flipping really needs the correct window height to
do proper Y coordinate flipping.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
2014-11-20 12:38:04 +01:00
Alexander Larsson
1eb3b34bce Add gdk_window_get_unscaled_size
This is required for the X backend GL integration. If the
window has a height that is not a multiple of the window scale
we can't properly do the y coordinate flipping that GL needs.
Other backends can ignore this and use the default implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
2014-11-20 12:38:04 +01:00
Alexander Larsson
788478dff9 x11: Return the exact pixel coverage in get_frame_extents
Rather than just rounding down the position *and* the size separately
we correctly calculate a rectangle in scaled window coords that fully
covers the real window size. This really only makes a difference
when the window size/position isn't a multiple of the window scale.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
2014-11-20 12:38:04 +01:00
Owen W. Taylor
bd643e0e1a x11: Keep track of the exact size in X pixels of windows
Keep track of the exact size of X windows in underlying pixels; we
generally use the scaled size instead, but to properly handle the GL
viewport for windows that aren't a multiple of window_scale,
we need to know the real size.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
2014-11-20 12:38:04 +01:00
Owen W. Taylor
608c25453b x11: round the scaled size *up* when we get a ConfigureNotify
Although we specify a resize increment to try and get a size that is
a multiple of the window scale, maximization typically wins
over the resize increment, so the window might be odd sized.

Round *up* in this case, rather than down, since it's better to
truncate a line or two at the bottom and right of the window rather
than have a line or two that we don't know what to do with.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
2014-11-20 10:19:27 +01:00
Marco Trevisan (Treviño)
f5d96f7110 mir: use proper naming for mir window type checking macro 2014-11-20 05:51:12 +01:00
Marco Trevisan (Treviño)
99d849412b mir: add public getter for the internal MirSurface 2014-11-20 04:41:45 +01:00
Marco Trevisan (Treviño)
60e185e496 mir: don't use struct MirConnection*, just the latter 2014-11-20 04:41:06 +01:00
Marco Trevisan (Treviño)
6e9db05601 mir: add OpenGL support
Implement GdkGLContext using EGL and use hardware mir surfaces
when a GdkWindow uses gl rendering.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740346
2014-11-20 04:33:38 +01:00
Marco Trevisan (Treviño)
e0e46a4f6b mir: update surface type based on events 2014-11-17 17:23:36 +01:00
Marco Trevisan (Treviño)
da8fdab87b mir: fix typo in GDK_IS_WINDOW_MIR definition 2014-11-17 14:02:22 +01:00
Marco Trevisan (Treviño)
acfc4f8910 mir: invert scrolling delta 2014-11-17 14:02:22 +01:00
Marco Trevisan (Treviño)
f5c5e9385e mir: handle more surface types 2014-11-14 23:19:15 +01:00
Marco Trevisan (Treviño)
8bc523ef59 mir: fix compilation in mirscreen 2014-11-14 23:19:15 +01:00
Chun-wei Fan
61286d5927 gdk/gdkgl.c: Fix Typo
The extra ';' actually broke builds on C89 compilers...
2014-11-14 17:26:29 +08:00
Marco Trevisan (Treviño)
c42146d88c mir: get/set window surface type 2014-11-13 04:42:48 +01:00
Marco Trevisan (Treviño)
c7e7e35083 mir: don't request more surface formats than the supported ones 2014-11-13 03:59:29 +01:00
Marco Trevisan (Treviño)
4e4ccb76cd mir: implement screen get_plug_name 2014-11-13 02:26:38 +01:00
Marco Trevisan (Treviño)
a77571c42e mir: clear screen objects correctly 2014-11-13 02:19:29 +01:00
Marco Trevisan (Treviño)
0d024c2df8 mir: don't crash when querying infos for an invalid monitor 2014-11-13 02:07:46 +01:00
Marco Trevisan (Treviño)
c8826ba8c7 mir: clear screen data 2014-11-13 01:59:21 +01:00
Marco Trevisan (Treviño)
98a8c66970 mir: correctly get screen mm sizes 2014-11-13 01:47:56 +01:00
Marco Trevisan (Treviño)
c6de20496c mir: unset config change callback on finalize 2014-11-13 01:34:10 +01:00
Marco Trevisan (Treviño)
92c2e99dda mir: actually pass the GdkMirScreen to display config change cb 2014-11-13 01:30:10 +01:00
Matthias Clasen
d9b02ea4a3 gdk: Make debug-updates a per-display setting
Add private API to set this per-display, and make the existing
gdk_window_set_debug_update function set a global default.
2014-11-10 15:23:14 -05:00
Matthias Clasen
5536d9bcde gdk: Add private API for rendering mode
This will be used to expose rendering mode in the inspector.
2014-11-10 14:39:57 -05:00
Matthias Clasen
8338b7e4cd Move rendering mode into GdkDisplay
This is in preparation for making it runtime-settable in the
inspector.
2014-11-10 14:28:43 -05:00
Javier Jardón
710f332082 configure.ac: Depend on cairo 1.14.0
This is needed for cairo_set_device_scale()
2014-11-10 15:12:17 +00:00
Alexander Larsson
90555e06be gdk_window_end_paint: Flush destination surface after paint
It seems in cairo 1.14 we need this after having painted an image surface
to a X11 window surface (i.e. with GDK_RENDERING=image).
2014-11-10 15:25:31 +01:00
Emmanuele Bassi
cdcd3ca359 Hide GdkWindow libgtk_only API in the private vtable
These are the last two global GDK symbols that have a libgtk_only
suffix.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Emmanuele Bassi
585af218a3 Move GDK GL flags accessors to the private vtable
This allows us to use the GDK_PRIVATE_CALL macro inside gtk.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Emmanuele Bassi
eedbec2066 Make global GDK libgtk_only functions more private
The current way of exposing GDK API that should be considered internal
to GTK+ is to append a 'libgtk_only' suffix to the function name; this
is not really safe.

GLib has been using a slightly different approach: a private table of
function pointers, and a macro that allows accessing the desired symbol
inside that vtable.

We can copy the approach, and deprecate the 'libgtk_only' symbols in
lieu of outright removal.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Jasper St. Pierre
433120ae5e gdkwindow-x11: Fix indentation 2014-11-07 17:39:43 -08:00
Carlos Garnacho
af6eab850e wayland: Schedule a clock tick instead of wl_surface_commit()ting directly
Instead of possibly calling wl_surface_commit() out of
GdkFrameClock::after-paint, tick the transient parent clock so ::after-paint
can be eventually run.

This ensures that the subsurface coordinates (considered part of the state
of the parent) aren't committed untimely, and guaranteed to be orderly with
the wl_subsurface-relative state.

This is a gtk-side fix for https://bugzilla.gnome.org/show_bug.cgi?id=738887
2014-11-07 17:24:10 +01:00
Carlos Garnacho
964abf7423 wayland: Don't translate a NULL region into an empty one
cairo_region_copy(NULL) will effectively return an empty region, as this
function is always meant to return valid memory. This however inverts the
meaning of the NULL region and results in entirely non-clickable windows.
2014-11-07 17:23:54 +01:00
Matthias Clasen
7e405c286f Don't make the gl flags API
We need to export the symbols so they can be used in the
inspector, but we don't really want to make this supported
public API, so keep them out of installed headers.
2014-11-07 07:10:49 -05:00
Matthias Clasen
5d0d1e524e Export API to set GL flags
This will be used in the inspector.
2014-11-06 23:29:16 -05:00
Jasper St. Pierre
22ad7b7782 gdkgl: Make some helper functions static 2014-11-06 13:48:20 -08:00
Ryan Lortie
ec729d0649 mir: rework cursors a bit
Store the cursor name on the cursor (rather than always using its type).

Use this when setting a cursor on a surface.

The mir server will fallback to using standard cursors from the cursor
theme if the name used is not one of those defined by mir, which is more
or less what we want to happen here in case of creating a cursor by
name.
2014-11-06 16:18:53 -05:00
William Hua
2fdb266c0d mir: set cursor 2014-11-06 16:18:53 -05:00
Alexander Larsson
41bf293efd GdkWindow: Drop gl matrix setup which is not needed anymore. 2014-11-06 20:37:24 +01:00
Alexander Larsson
61eabc4778 gdk_gl_texture_from_surface: Enable scissor test 2014-11-06 20:37:10 +01:00
Alexander Larsson
56631d02bd gdk_gl_texture_quad: Fix handling of window scales 2014-11-06 19:33:58 +01:00
Alexander Larsson
1f3f933edf GdkX11GLContext: Use bitblit for swap if no buffer age support
If buffer age is undefined and the updated area is not the whole
window then we use bit-blits instead of swap-buffers to end the
frame.

This allows us to not repaint the entire window unnecessarily if
buffer_age is not supported, like e.g. with DRI2.
2014-11-06 12:24:43 +01:00
Alexander Larsson
21189b9f7e Add gdk_gl_context_has_framebuffer_blit()
This checks if the context supports GL_EXT_framebuffer_blit
2014-11-06 12:24:43 +01:00
Alexander Larsson
5f9e6ec2dc GdkGL: Fix up GL_ARB_texture_rectangle support
This broke when gdk_gl_texture_quad moved to shaders. We need
a specialized shader for the rectangle case.
2014-11-06 12:24:43 +01:00
Alexander Larsson
650c9f3b7e Add support for GDK_GL=texture-rectangles
This allows us to test our support for GL_ARB_texture_rectangle
2014-11-06 12:24:43 +01:00
Alexander Larsson
90a5fa80af Add GDK_GL env var and GdkGLFlags
This moves the GDK_ALWAYS_USE_GL env var to GDK_GL=always.
It also changes GDK_DEBUG=nogl to GDK_GL=disable, as GDK_DEBUG
is really only about debug loggin.

It also adds some completely new flags:

 software-draw-gl:
   Always use software fallback for drawing gl content to a cairo_t.
   This disables the fastpaths that exist for drawing directly to
   a window and instead reads back the pixels into a cairo image
   surface.

 software-draw-surface:
   Always use software fallback for drawing cairo surfaces onto a
   gl-using window.  This disables e.g. texture-from-pixmap on X11.

 software-draw:
   Enables both the above.
2014-11-06 12:24:43 +01:00
Alexander Larsson
7fde5213b0 gdk_cairo_draw_from_gl: Remove useless call
The glFramebufferTexture2DEXT call makes no sense here, we're
not using the texture as a framebuffer, just as a normal
texture source.
2014-11-06 12:24:43 +01:00
Alexander Larsson
9372cbdbf8 GdkWindow: Try to use a Core 3.2 GL profile for the paint context
If this is supported we avoid a lot of legacy baggage which we don't
need.
2014-11-06 12:24:43 +01:00
Alexander Larsson
e417b18373 gdk_gl_texture_quad: Use shaders to texture things
This is the modern way OpenGL works, and using it will let us
switch to a core context for the paint context, and work on
OpenGL ES 2.0.
2014-11-06 12:24:43 +01:00
Alexander Larsson
c78e7e7f17 GdkGL: Rename "context" to "paint_context" to clarify things a bit 2014-11-06 12:24:43 +01:00
Alexander Larsson
aaa335b9e8 gdk_cairo_draw_from_gl: Document that this changes the current context 2014-11-06 12:24:43 +01:00
Alexander Larsson
8c6395d8a1 GdkGLContextX11: Use passed in context, not get_current() 2014-11-06 12:24:43 +01:00
Alexander Larsson
10a44e8f7a Add gdk_gl_texture_quad() helper
Right now this just centralizes the glBegin/glEnd code, but
this will be replaced with buffer objects later.
2014-11-06 12:24:43 +01:00
Alexander Larsson
3c34ca3405 gdkgl: Don't constantly re-create the tmp framebuffer 2014-11-06 12:24:43 +01:00