Commit Graph

6103 Commits

Author SHA1 Message Date
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