Commit Graph

170 Commits

Author SHA1 Message Date
William Hua
dbb3f84796 mir: don't create GDK_INPUT_ONLY windows 2017-03-06 10:36:45 -05:00
William Hua
54791b65bd mir: deprecate gdk_mir_window_get_mir_surface () 2017-03-01 02:15:56 -05:00
William Hua
f98e3dd09a mir: delete commented debug output 2017-03-01 02:15:56 -05:00
William Hua
bdf559c623 mir: migrate away from deprecated mir api 2017-03-01 02:15:56 -05:00
William Hua
e07dea5d97 mir: move #include to correct file 2017-03-01 02:15:56 -05:00
William Hua
2088cc3395 mir: handle surface placement events
This allows the Mir backend to properly emit "moved-to-rect."
2017-01-30 03:06:59 -05:00
William Hua
b09b69472b mir: use mir_surface_spec_set_placement for menus
This API was added to Mir for GTK menus, combo boxes, etc.
2017-01-30 03:06:01 -05:00
William Hua
670ae58cc9 mir: use modal window hint 2017-01-12 17:24:19 -05:00
William Hua
57a11ca28d mir: fix compile-time warnings 2017-01-09 17:55:31 -05:00
William Hua
a50a98f38b mir: properly handle empty clipboard
https://bugzilla.gnome.org/show_bug.cgi?id=775732
2017-01-09 12:04:48 -05:00
Benjamin Otte
7ade6e3f46 gdk: Remove testing functions
They were unused and unimplemented.
2017-01-08 03:46:30 +01:00
William Hua
384fe52e96 mir: paste clipboard data from content-hub
https://bugzilla.gnome.org/show_bug.cgi?id=775732
2017-01-05 17:57:36 -05:00
William Hua
516c0a2aab mir: copy clipboard data to content-hub
https://bugzilla.gnome.org/show_bug.cgi?id=775732
2017-01-05 17:57:36 -05:00
William Hua
dcda372c15 mir: connect to content-hub
https://bugzilla.gnome.org/show_bug.cgi?id=775732
2017-01-05 17:57:36 -05:00
William Hua
440e80c832 mir: track focused window
https://bugzilla.gnome.org/show_bug.cgi?id=775732
2017-01-05 17:57:36 -05:00
William Hua
ed0bd0bba2 mir: implement window properties
https://bugzilla.gnome.org/show_bug.cgi?id=775732
2017-01-05 17:57:36 -05:00
Alexander Larsson
330c7feaa2 gdk: Drop gdk_window_reparent
We're not currently using this, and dropping it allows us to loose
a bunch of code which leads us towards the goal of having GdkWindow
only for toplevels (and reparenting makes not sense for toplevels).
2016-12-16 12:35:03 +01:00
Alexander Larsson
5bf28a3869 gdk: Drop support for native (and thus foreign) subwindows
We can't really support these on e.g. wayland anyway, and we're trying
to get rid of subwindow at totally in the long term, so lets drop this.
It allows us to drop a lot of complexity.
2016-12-16 12:28:44 +01:00
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