Commit Graph

152 Commits

Author SHA1 Message Date
William Hua
9a7b0847b9 mir: swap buffers on paint 2016-12-08 15:28:31 -05:00
William Hua
3c2aefddd4 mir: fix type warning 2016-12-05 11:06:32 -05:00
William Hua
32b3928eda mir: fix build failures 2016-12-05 10:28:48 -05:00
William Hua
e27e8e6e1c mir: implement display monitor vfuncs 2016-12-05 09:17:44 -05:00
Benjamin Otte
8915be00d1 gdkgl: Add gdk_gl_context_get_damage()
This is a way to query the damaged area of the backbuffer.

The GL renderer uses this to compute the extents of that damage region
(computed via buffer age) and use them to minimize the area to redraw.

This changes the semantics of GL rendering to "When calling
gdk_window_begin_frame() with a GL context, the area by
gdk_gl_context_get_damage() needs to be redrawn and every other pixel of
the backbuffer is guaranteed to be correct.
After gdk_window_end_frame() on a GL-drawn window, the whole backbuffer
must be correct.

We can always glXBufferSwap() now because of this.
2016-12-05 15:02:47 +01:00
Benjamin Otte
ca78f5d3cb gdk: Make gdk_window_begin_draw_frame() take a draw context
... instead of a gl context.

This requires some refactoring in the way we mark the shared context as
drawing: We now call begin_frame/end_frame() on it and ignore the call
on the main context.
Unfortunately we need to do this check in all vfuncs, which sucks. But I
haven't found a better way.
2016-12-05 15:02:47 +01:00
Benjamin Otte
725a7236c0 gdk: Turn GdkGLContext into a GdkDrawContext 2016-12-05 15:02:47 +01:00
Benjamin Otte
e87b472143 glcontext: Make begin/end_draw() paired
This way, we can query the GL context's state via
gdk_gl_context_is_drawing().

Use this function to make GL contexts as attached and grant them access
to the front/backbuffer for rendering.

All of this is still unused because GL drawing is still disabled.
2016-12-05 15:02:47 +01:00
Benjamin Otte
182d18bcd1 gdk: Large GL refactoring
No visible changes as GL rendering is disabled at the moment.

What was done:

1. Move window->invalidate_for_new_frame to glcontext->begin_frame
This moves the code to where it is used (the GLContext) and prepares it
for being called where it is used when actually beginning to draw the
frame.

2. Get rid of buffer-age usage
We want to let the application render directly to the backbuffer.
Because of that, we cannot make any assumptions about the contents the
application renders outside the clip area.
In particular GskGLRenderer renders random stuff there but not actual
contents.

3. Pass the actual GL context
Previously, we passed the shared context to end_frame, now we pass the
actual GL context that the application uses for rendering. This is so
that the vfuncs could prepare the actual contexts for rendering (they
don't currently).

4. Simplify the code
The previous code set up the final drawing method in begin_frame.
Instead, we now just ensure the clip area is something we can render
and decide on the actual method in end_frame.
This is both more robust (we can change the clip area in between if we
want to) and less code.
2016-12-05 15:02:47 +01:00
Benjamin Otte
efd04b47aa gdk: Make GdkDrawingContext not per-backend
No backend is using it, and we can put the backend-specific drawing code
into GdkGLContext.
2016-11-30 15:52:22 +01:00
William Hua
3efbb75619 mir: fix build failures 2016-11-27 21:31:21 -05:00
Benjamin Otte
2a27b7ecc6 API: Remove gdk_window_process_all_updates()
It's completely unused since we have a frame clock.
2016-11-23 19:10:34 +01:00
Benjamin Otte
cb18752f94 gdk: Make each backend have a custom GdkDrawingContext subclass 2016-11-20 07:19:52 +01:00
Benjamin Otte
d2c26c471c gdk: Remove attributes_mask from gdk_window_new()
The only remaining values were always treated as 0, so we just hardcode
them to 0.
2016-11-07 01:33:43 +01:00
Benjamin Otte
7a6cab14eb gdkwindow: Remove GdkWindowAttr.type_hint
Instead, let the callers call gdk_window_set_type_hint(). Which is
surprsingly what every backend did.
2016-11-06 16:22:21 +01:00
Benjamin Otte
9707f4d3b3 API: gdk: Remove title from gdk_window_new()
Use gdk_window_set_title() afterwards instead.
2016-11-05 03:32:27 +01:00
Benjamin Otte
33e7a7898f API: gdk: Remove gdk_window_set_override_redirect()
When you want an override-redirect window, you create it that way.
Changing that behavior is not supported anywhere (but on X of course).
2016-11-05 03:32:27 +01:00
Benjamin Otte
77a9e90cb9 mir: Remove all mentions of visuals 2016-11-04 00:15:52 +01:00
Benjamin Otte
4585af5719 gdk: Remove visual APIs from GdkScreen
gdk_screen_list_visuals(), gdk_screen_get_system_visual() and
gdk_screen_get_rgba_visual() are gone now.
2016-11-04 00:02:37 +01:00
Benjamin Otte
d249e77bcb API: screen: Remove gdk_screen_is_composited()
Switch code to use gdk_display_is_composited() instead.

The new code also doesn't use a vfunc to query the property but rather
requires the backend to call set_composited()/set_rgba() to change the
value.
2016-10-29 04:49:47 +02:00
Benjamin Otte
45c0379f87 API: gdk: Remove visual querying APIs
They are unused, only work on the default display anyway and visuals are
on their way out.
2016-10-28 05:22:50 +02:00
Benjamin Otte
f420dc7456 API: gdk: Remove gdk_window_get_visual()
With it, remove window->visual.
2016-10-28 05:22:49 +02:00
Alexander Larsson
70935f0952 Drop support for offscreen GdkWindows
These complicate a lot of GdkWindow internals to implement features
that not a lot of apps use, and will be better achieved using gsk.
So, we just drop it all.
2016-10-25 09:54:37 +02:00
Benjamin Otte
eace2cf421 API: Remove gdk_window_set_background()
Backgrounds are always transparent black.
2016-10-16 18:17:21 +02:00
Benjamin Otte
89f2e17f91 API: Remove gdk_window_set_composited()
And the related call gdk_display_supports_composite().
2016-10-16 18:17:21 +02:00
Benjamin Otte
8d54c641f1 screen: Remove unused vfunc
GdkScreenClass.broadcast_client_message was unused, but a bunch of
backends still had functions (not) implementing it.
2016-10-16 18:17:21 +02:00
Benjamin Otte
9be9e00a0e API: screen: Remove gdk_screen_make_display_name()
It's identical to gdk_display_get_name().
2016-10-16 18:17:21 +02:00
Benjamin Otte
6b9e481e38 API: screen: Remove gdk_screen_get_active_window()
... and gdk_screen_get_window_stack().

Those functions were originally added in
5afb4f0f11 but do not seem to be used as
they are not implemented anywhere but in X.

As GDK is not meant to fulfill window management functionality I'm going
to remove these functions without replacements.
2016-10-16 18:17:21 +02:00
Benjamin Otte
26f9b584be API: gdk: Remove gdk_screen_get_number()
It's useless everywhere but in internal X11 code.
2016-10-16 18:17:21 +02:00
Matthias Clasen
d053d5c58f Rename Makefile references from 3.0 to 4.0
This is almost certainly incomplete.
Needs careful scrutiny
2016-10-07 10:34:50 -04:00
Andreas Pokorny
fe216b0039 Do not filter out small scroll event fractions
The scroll motion values are subject of batching and scaling. Either
through scaling or by using a touchpad smooth scroll motion changes
below 0.5 are possible.

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

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-09-26 11:49:56 -04:00
William Hua
7665ee4208 mir: group DND, tooltips, and notifications with menu-type windows 2016-08-12 11:37:35 -04:00
Andreas Pokorny
b2719c0383 Remove outdated comments
https://bugzilla.gnome.org/show_bug.cgi?id=768138
2016-08-11 12:23:38 -04:00
Andreas Pokorny
3334e0a21d Use Menus to implement tooltips
The order in which tooltips are created, drawn, shown and then positioned,
always requires repositioning the surface. The tooltip window type only has
limited capability to do so. An alternative could be to use bufferstreams.

https://bugzilla.gnome.org/show_bug.cgi?id=768138
2016-08-11 12:23:38 -04:00
Andreas Pokorny
056ddf2567 Fix execution of dialog
When a dialog is created, the mir event source is already executed on the
call stack. So without the recurse flag it will not be run in the main loop
used for the dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=768138
2016-08-11 12:23:38 -04:00
Andreas Pokorny
f95d270372 Only apply type hint if it would map to a different mir surface type
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:41:27 -04:00
Andreas Pokorny
da17eae747 Apply geometry hints to mir surface
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
96dcf89155 Apply and forward title changes of gdk windows
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
6dfb554558 Only update surface spec when there is no spec change pending 2016-08-10 13:36:38 -04:00
Andreas Pokorny
5a8af1af75 Rework window construction - only recreate surface when necessary
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
83471052cf Forward repeated key presses as further down keys
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
097ed2b40a Fix warning on newer version so mir 0.22 and newer
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
bc4df6d4b3 Fix gcc warning on potentially uninitialized gdk_event. 2016-08-10 13:36:38 -04:00
Andreas Pokorny
252ccb846f Use the surface output event to keep track of the suggested scale value
The event will be sent when the surface becomes visible on an output. With this change the GdkMirWindowImpl keeps track of the scale value and sends a configure event on change.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Matthias Clasen
82fd72a477 Opt in to structured logging
Define G_LOG_USE_STRUCTURED, so that all our g_debug, g_warning,
etc calls directly use structured logging and provide source information.
2016-07-22 23:13:20 -04:00
William Hua
748ebd3d72 mir: implement gdk_window_move_to_rect ()
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
Matthias Clasen
0f476590fb Make gdk_event_get_pointer_emulated public
There is not strong reason to keep the getter private.
At the same time, strip _-prefixes from a few other GdkEvent
APIs. Update all callers.
2016-05-10 15:16:45 -04:00
Frediano Ziglio
cf14fea5a8 Save scancode inside GdkEventPrivate
Windows save in hardware_keycode an information which is not so low
level and some application require the hardware scancode.
As Windows provides this information save it in GdkEventPrivate
and provide a function to get this information.
For no Windows system the function return the hardware_keycode instead.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=765259
2016-04-21 22:35:47 -04:00
Rico Tzschichholz
1e27fe83ea mir: display->list_devices vfunc was dropped
See 4a6f8a065a

https://bugzilla.gnome.org/show_bug.cgi?id=762891
2016-03-02 10:24:44 +01:00
Paolo Borelli
38ad57948c gdk: remove the core_pointer field from GdkDisplay
It is not used anymore, so no need to set it

https://bugzilla.gnome.org/show_bug.cgi?id=762820
2016-02-29 14:15:04 +01:00