Compare commits

..

75 Commits

Author SHA1 Message Date
afb4165262 Bump version to 3.22.3
Update NEWS.
2017-02-16 18:11:49 +01:00
6161aacde7 wayland: Fix build
Missing s/MetaLogicalMonitor/MetaMonitorInfo/ when backporting 6e272229
2017-02-16 18:10:36 +01:00
4d300db0e2 wayland/keyboard: Avoid a division by zero
We don't further sanitize the values since the protocol allows for
everything as long as it's non-negative.

https://bugzilla.gnome.org/show_bug.cgi?id=776919
2017-02-16 16:51:57 +01:00
b465546a52 meta-input-settings: Avoid setting key repeat delay or interval to 0
Since doing so causes either errors or misbehavior.

https://bugzilla.gnome.org/show_bug.cgi?id=776919
2017-02-16 16:51:57 +01:00
443250a9f7 MetaInputSettings: allow edge scrolling without 2fg capable devices
We should only force edge scrolling off if two finger is enabled *and*
we actually have two finger capable devices.

https://bugzilla.gnome.org/show_bug.cgi?id=778554
2017-02-16 16:51:57 +01:00
1d24f612cc wayland: Update tool cursor scale when crossing monitors
This makes tool cursors properly scaled on hidpi.

https://bugzilla.gnome.org/show_bug.cgi?id=778474
2017-02-15 23:35:24 +01:00
6e2722298e wayland: Keep pointer to cursor sprite on MetaWaylandTabletTool
https://bugzilla.gnome.org/show_bug.cgi?id=778474
2017-02-15 23:35:11 +01:00
917aef5090 backends: extend tablet device checks
The Clutter X11 backend can't drop CLUTTER_PEN_DEVICE and
CLUTTER_ERASER_DEVICE in favor of CLUTTER_TABLET_DEVICE without
losing information (as the driver will create one device for each).
So make MetaInputSettings cater for both sets of device types.

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

(backported from master for
https://bugzilla.gnome.org/show_bug.cgi?id=775635)
2017-02-15 17:59:38 +01:00
58669e7598 keybindings: fix erratic raise_or_lower behavior
Function "handle_raise_or_lower (src/core/keybindings.c)" is called
when running 'raise-or-lower' on a window. This function iterates
through all the windows in the stack to determine if our window is
already on top or obscured. The problem is that the window stack
includes windows in another workspaces and also windows that are
minimized.

https://bugzilla.gnome.org/show_bug.cgi?id=705200
2017-02-07 14:44:51 +01:00
998aa532d0 Use eglGetPlatformDisplay
Different libEGL will do different things for eglGetDisplay since it has
to guess what kind of display it's been handed. Better to just use the
API that makes it explicit.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772422
2017-02-07 14:44:51 +01:00
050e4acdae wayland: fix copy/pasto sending tool removed on rings/strips
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

https://bugzilla.gnome.org/show_bug.cgi?id=778262
2017-02-07 14:44:51 +01:00
8ccbd36315 MetaCursorRendererNative: Always force set hw cursor the first time
The initial state of the hardware cursor is not known, so always force
update it the first time we update the cursor. Do this by changing the
'force' flag of update_hw_cursor() to an 'invalidated' hw cursor state.

https://bugzilla.gnome.org/show_bug.cgi?id=771056
2017-02-07 10:50:29 +08:00
790b386c5f Update zh_CN translation 2017-02-05 18:17:54 +08:00
d4d3dbd088 monitor-manager: Get monitor info scale from main output tile
We didn't ever set the monitor info scale for tiled outputs; lets do
that by taking it from the main output.

https://bugzilla.gnome.org/show_bug.cgi?id=777470
2017-02-03 18:02:51 +08:00
23c315ea71 compositor: Avoid thaw on inconsistent effect_completed calls
If the meta_window_actor_effect_completed() triggers inconsistent
accounting, there's also high chances that the thaw call will be
unexpected at this time too, which will lead to a g_error().

This makes mutter more lenient to effect_completed() calls of the
right type (i.e. those triggering freeze/thaw) being performed more
times than necessary in the upper parts. A warning will be issued,
but the process won't abort.

https://bugzilla.gnome.org/show_bug.cgi?id=777691
2017-01-26 12:34:49 +01:00
18a4b9fb2c clutter/evdev: Dispatch libinput before generating key repeat events
Since both the libinput event source and the key repeat timer have the
same priority, the order in which both handlers are called is
arbitrary if both sources are ready on the same poll return. This
means that sometimes we generate key repeats when there's already a
real key event queued on libinput that would cancel the repeat timer
if only it was processed before.

One solution would be lowering the repeat timer source priority a
notch lower than the libinput source but that would mean that a steady
stream of events from libinput (e.g. pointer device motion) would
prevent any key repeats to happen.

Instead, we can fix this problem by trying to dispatch libinput from
the key repeat timer and checking if the timer source has been
destroyed before generating more key repeats.

https://bugzilla.gnome.org/show_bug.cgi?id=774989
2017-01-25 13:10:15 +01:00
2166a496fe clutter/evdev: Avoid losing key repeat timestamp resolution
Commit 9214d5029c changed the notify*
API to use microseconds and we already have a microsecond time source
here so we can use the timestamp directly without losing resolution at
this layer.

https://bugzilla.gnome.org/show_bug.cgi?id=774989
2017-01-25 13:10:14 +01:00
f8fd02d6ee backends: Calculate output scale correctly on vertical transforms
The code calculating the output scale involves calculations around pixel
and mm sizes, however we do compare post-transformation pixel sizes to
untransformed mm sizes, which breaks the DPI calculations. Fix this by
transforming back pixel sizes back to untransformed.

While we're at it, actually compare the output height to HIDPI_MIN_HEIGHT
instead of its width, it seems right according to the #define name and
comment.

https://bugzilla.gnome.org/show_bug.cgi?id=777687
2017-01-25 09:20:12 +01:00
2ae42f0db2 wayland/xdg-shell: Scale window menu coordinates
When the monitor the surface is on has a scale other than 1, the
coordinate of the window menu popup position needs to be scaled, as it
is reported in logical pixels, while the stage is still in physical
pixels.

https://bugzilla.gnome.org/show_bug.cgi?id=776055
2017-01-03 15:30:41 +08:00
06f5b6b3e3 wayland: Preserve the event mask on the root window
A window manager must select the SubstructureRedirect mask on the root
window to receive the MapRequest from the X11 clients and manage the
windows. Without this event mask set, a window manager won't be able to
map any new window.

The Wayland selection code in mutter can change/clear the event mask on
the requestor window from a XSelectionRequest event when the window is
not managed by mutter/gnome-shell.

A rogue or simply buggy X11 client may send a XConvertSelection() on the
root window and mutter will happily change/clear its own event mask on
the root window, effectively turning itself into a regular X11 client
unable to map any new X11 window from the other X11 clients.

To avoid this, simply check that the requestor window is not the root
window prior to change/clear the event mask on that window.

https://bugzilla.gnome.org/show_bug.cgi?id=776128
2016-12-15 13:02:11 +01:00
d9fc81e702 wayland: Ensure we don't focus xdg_popups iff they're non-grabbing
Commit 4295fdb892 made us skip focusing
all xdg_popups instead of just non-grabbing ones as intended. This
means that when unmanaging a window we might select a xdg_popup window
to focus (in meta_stack_get_default_focus_window() ) but then since we
don't actually focus it we go on unmanaging the focused window which
triggers an assertion, as it should.

To avoid this and still fixing bug 771694 we can make use of the
MetaWindow->input property for non-grabbing xdg_popup windows since
their semantics, in this regard, are the same as no input X11 windows.

This way, when unmanaging a focused window while a xdg_popup is up,
we'll either give focus to the xdg_popup or not select the popup at
all to be focused if it's non-grabbing.

https://bugzilla.gnome.org/show_bug.cgi?id=775986
2016-12-13 14:51:04 +01:00
497a94fac7 MetaRendererNative: Flush all pending swap notifies on idle
We need to do swap notifications asynchronously from flip events since
these might be processed during swap buffers if we are waiting for the
previous frame's flip to continue with the current.

This means that we might have more than one swap notification queued
to be delivered when the idle handler runs. In that case we must
deliver all notifications for which we've already seen a flip event.

Failing to do so means that if a new frame, that only swaps buffers on
such a swap notification backlogged Onscreen, is started, when later
we get its flip event, we'd notify only an old frame which would hit
this MetaStageNative's frame_cb() early exit:

  if (global_frame_counter <= presented_frame_counter)
    return;

and we'd never finish the new frame and thus clutter's master clock
would be waiting forever stuck.

https://bugzilla.gnome.org/show_bug.cgi?id=774557
2016-12-07 16:47:22 +01:00
a943c0fc12 meta-monitor-config: Initialize MetaConfiguration's properly
We weren't initializing the ref count which means we could either be
leaking or end up using free'd memory.

https://bugzilla.gnome.org/show_bug.cgi?id=774135
2016-11-21 15:33:53 +01:00
76f890a26f constraints: Don't early out of custom rule if window can't fit
Still go through the rules. For example a tall menu might still be
positioned better, and/or shrunk to a better size if applicable.

https://bugzilla.gnome.org/show_bug.cgi?id=771297
2016-11-21 12:53:37 +08:00
5c46094d67 meta-input-settings-x11: Don't try setting unavailable scroll methods
Since doing so causes BadValue X errors.

https://bugzilla.gnome.org/show_bug.cgi?id=771744
2016-11-16 13:48:05 +01:00
a601639dd3 Bump version to 3.22.2
Update NEWS.
2016-11-10 15:11:39 +01:00
462d504ca0 compositor: End a wayland popup grab when starting a compositor grab
Wayland popup grabs, unlike other grab types, can be safely cancelled
so there's no reason to deny compositor grab requests if a wayland
popup is on.

In particular, this allows entering the overview via a keybinding or
locking the screen while a wayland popup has a grab which is something
that's been advertised as a wayland improvement over X.

https://bugzilla.gnome.org/show_bug.cgi?id=771235
2016-11-02 14:06:41 +01:00
374bba2d4e MetaInputSettings: fix two finger preference over edge scrolling logic
Enabling edge scrolling before disabling two finger would result in
edge scrolling not actually being enabled because two finger is still
enabled at the time and we bail out.

This patch moves this logic to common code for both the native and X
backends and fixes it by ensuring that both settings are never set at
the same time and still re-checking if edge scrolling should be
enabled after two finger scrolling gets disabled.

We also simplify the code by not checking for supported/available
settings since the underlying devices will just reject those values
and there isn't anything we can do about it here. It's the UI's job to
only show supported/available settings to users.

https://bugzilla.gnome.org/show_bug.cgi?id=771744
2016-11-02 14:06:40 +01:00
1b4b361a92 MetaInputSettingsNative: allow unsetting click and scroll methods
Checking for supported methods isn't needed since libinput will just
error out and do nothing itself if a requested method isn't supported
and, in fact, this logic was preventing the enum values 0 from being
set.

https://bugzilla.gnome.org/show_bug.cgi?id=771744
2016-11-02 14:06:39 +01:00
6054b1cdbd stack: Stack docks below other windows on fullscreen monitors
Commit fcc7501eb8 had the side-effect of
stacking fullscreen windows below docks which went unnoticed since we
don't use docks in GNOME anymore.

Instead of re-introducing the fullscreen layer, which we don't need
otherwise, we can fix this issue by ensuring we stack docks below all
other windows when the monitor they're on is marked fullscreen. This
has the added benefit that the visibility rule for 3rd party docks
becomes the same as gnome-shell's chrome.

https://bugzilla.gnome.org/show_bug.cgi?id=772937
2016-11-02 14:06:37 +01:00
f3a9465fbd Update zh_CN translation 2016-10-30 02:34:13 +08:00
ac5ea45319 Update zh_CN translation 2016-10-30 02:20:39 +08:00
c52808b30d wayland: do not explicitly focus xdg_popup
The keyboard focus semantics for non-grabbing xdg_shell v6 popups is
pretty undefined.

Same applies for subsurfaces, but in practice, subsurfaces never receive
keyboard focus, so it makes sense to do the same for non-grabbing
popups.

https://bugzilla.gnome.org/show_bug.cgi?id=773210
2016-10-27 17:27:40 +02:00
5919a4a779 window: Do not unfocus on new window
mutter would remove focus from a toplevel when showing one of its
transient window which is not on top and not focused.

When using xdg_popup without grab as allowed in xdg_shell v6, the popup
wouldn't be focused, and if an intermediate event occurs before the
popup is shown, it's not placed on top either, which could randomly
trigger a loss of focus in the corresponding toplevel window.

Remove that special case, it doesn't make much sense to globally unset
focus when mapping a new window.

https://bugzilla.gnome.org/show_bug.cgi?id=773210
2016-10-27 17:27:35 +02:00
e8fc09064a wayland: apply size hints after placing the window
Otherwise the window will be shown initially in the wrong position then
moved quickly as soon as it's made visible, which is confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=772729
2016-10-19 17:31:44 +08:00
d911c5aac4 wayland: Don't cancel the pointer grab on compositor grabs
We shouldn't cancel the pointer grab when there is a compositor grab,
since that'd break things like drag-n-drop via the overview and
alt-tabs.

The original reason for cancelling the pointer grab on compositor grabs
was to avoid a re-entry when a compositor grab was activated while
there was an active pointer constraint grab. The re-entry would happen
when the compositor grab cleared the pointer focus. Clearing the focus
would trigger the pointer constraint to be deactivated, which would end
its grab. Ending the grab would reset the grab to the default one, which
could focus the same surface again, triggering the constraint to
re-enable before it finished disabling.

This is now avoided because the default grab handler is now aware of
compositor grabs, and won't override the cleared pointer focus until
the compositor grab ends.

https://bugzilla.gnome.org/show_bug.cgi?id=772914
2016-10-19 17:23:26 +08:00
84134aa78e wayland/pointer: Don't set focus while during compositor grab
Teach the default grab about compositor grabs (i.e.
display->event_route) so that it can avoid setting a pointer focus when
after the compositor grab actively unset the pointer focus.

https://bugzilla.gnome.org/show_bug.cgi?id=772914
2016-10-19 17:23:16 +08:00
f9d1bb4e6c wayland/pointer-constraints: Don't include window frame in region
When Xwayland confines, the surface dimensions will include the server
side window manager decorations. We don't want the decorations to be
included in the constraint region so intersect the calculated input
region with the parts of the buffer rect that is not part of the window
frame.

https://bugzilla.gnome.org/show_bug.cgi?id=771859
2016-10-19 17:20:14 +08:00
1da239c83c wayland/pointer-constraints: Unify requirements for enablement
Put the conditions for enabling a pointer constraint in a helper
function, and use that in both maybe_enable() and maybe_remove(). The
constraint region checking is still only done in maybe_enable()
however.

This changes the conditions for maybe disabling the constraint on focus
change and other trigger points, namely it makes constraints by Xwayland
not disable when they shouldn't due to the constraining window being an
override-redirect window.

https://bugzilla.gnome.org/show_bug.cgi?id=771859
2016-10-19 17:20:14 +08:00
d22db60a2b wayland/pointer-constraints: Disable or remove when grab is cancelled
When the grab is cancelled, for example because of an Alt-tab, VT
switch etc, disable or remove (depending on the constraint type) the
constraint. This avoids a re-entry issue when the focus is returned and
the focus listener tries to re-enable a disabled constraint.

https://bugzilla.gnome.org/show_bug.cgi?id=771859
2016-10-19 17:20:14 +08:00
ab21c3cad7 MetaWaylandPopup: Dismiss popup when grab is cancelled
Dismiss the popup when the grab is cancelled, so that if the grab is
ended for whatever reason (such as VT switching or the last pointer
being disconnected), it doesn't try to end the grab when it isn't
active.

This fixes a crash when VT switching back and forth while a popup grab
is active.

https://bugzilla.gnome.org/show_bug.cgi?id=771858
2016-10-19 17:03:27 +08:00
20efdfcb41 wayland/pointer: Add way to cancel current grab
Previously a grab could suddenly end without the grabber knowing
anything about it. Some grabs assume they won't suddenly end without
notice, and can use then new 'cancel' vfunc to be notified.

Currently a grab is cancelled when a new one is started (i.e. in
meta_wayland_pointer_grab_start()), when a non-popup compositor wide
event route is initiated, and when the seat looses the pointer
capability.

https://bugzilla.gnome.org/show_bug.cgi?id=771858
2016-10-19 17:03:16 +08:00
1d8bb58990 constraints: Use ConstraintInfo window size when placing
The frame rect will at this point not be set for Wayland popups, since
the popup is placed and constrained before the actual buffer will be
attached. To still be able to calculate a proper monitor to be used for
constraining, use the ConstraintInfo::current dimensions instead, since
they will have the expected size. This should not cause any issues with
present paths since when a window is otherwise placed, it usually
doesn't change monitor calculation result.

This fixes opening a popup menu that would be positioned on the left
edge of a not-left-most monitor, for example a 'File' menu on a window
maximized on a second monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=773141
2016-10-19 15:16:46 +08:00
32877118c3 MetaOnscreenNative: fix mirror mode with stage views
Using the view's MetaMonitorInfo to find all the crtcs which should be
configured to display a given onscreen doesn't work unfortunately. The
association runs only the other way around, i.e. we need to go through
each crtc and find the ones corresponding to our monitor info.

https://bugzilla.gnome.org/show_bug.cgi?id=773115
2016-10-18 14:19:23 +02:00
6567e235a4 MetaRendererNative: don't call drmModeGetResources()
There's no need to call this and we were leaking the returned memory.

https://bugzilla.gnome.org/show_bug.cgi?id=773116
2016-10-18 14:19:22 +02:00
0289925101 MetaMonitorManageKms: plug a GArray leak
https://bugzilla.gnome.org/show_bug.cgi?id=773116
2016-10-18 14:19:20 +02:00
ffea28e05d wayland/xdg-shell: Scale positioner coordinates
When the monitor is scaled (i.e. HiDPI scaling) the placement coordinates
ere still in unscaled xdg_surface window geometry coordinate space when
used to place the window. Fix this by scaling the coordinates by the
monitor scale of the parent toplevel window before using them.

https://bugzilla.gnome.org/show_bug.cgi?id=771841
2016-10-18 13:21:06 +08:00
43a1ac3b5f wayland/xdg-shell: update popup window monitor early
As meta_window_place_with_placement_rule will trigger a configure event
being sent ensure that the popup is placed on the correct monitor first
to ensure the right scale factor is applied.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=771841
2016-10-18 13:21:06 +08:00
a15d61ba9b wayland/xdg-popup: Force monitor of the top-level
Directly set the monitor of the toplevel window for the popup to avoid
the change not being applied due to later constraints calculation.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=771841
2016-10-18 13:21:06 +08:00
2eaa9de9da wayland/xdg-shell: Scale configure relative popup coordinate
The parent local popup coordinate needs to be scaled according to the
monitor scale it is assigned.

https://bugzilla.gnome.org/show_bug.cgi?id=771841
2016-10-18 13:21:06 +08:00
c042c835a5 wayland/xdg-popup: Always use monitor of toplevel
Always use the monitor of the toplevel surface's window, so that the
popup menu and the parent will always have the same scale. This fixes
the dimensions sent in the xdg_popup configure event.

https://bugzilla.gnome.org/show_bug.cgi?id=771841
2016-10-18 13:21:06 +08:00
803148ed1f wayland/touch: Use surface relative coordinate helper
Use the global to surface local coordinate converter helper, as that
will currently convert coordinates for Xwayland client more correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=768039
2016-10-18 13:21:06 +08:00
006c83f99d wayland/touch: Use helper for getting the next event serial
https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
9f071fdc87 wayland/pointer: Use grab helper that doesn't focus when disabling
Instead of using meta_wayland_pointer_end_grab() which focuses the new
grab, add a new helper mean to be used to reset the grab state without
changing the pointer focus. When using this function, the call site is
supposed to explicitly manage focus.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
5216137146 wayland/pointer: Naming and coding style fixes
Some very long lines that stood out were shortened, and an old naming
convention from weston was removed.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
35be843f52 wayland/pointer: Check pointer presence at set focus call site
Make the caller of focus setting check whether there is a pointer to
update the focus state of. It makes it more obvious what to expect, as
the call would be a no-op in when no pointer is present.

Grabbing is still allowed without the presence of a pointer because it
is used by popups even on touch-only systems.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
6c2e43f76c wayland/pointer: Use helper for getting the next event serial
Use the MetaWaylandInputDevice helper for serial retrieval.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
b171668ae0 wayland/keyboard: Check keyboard presence at set focus call site
Make the caller of focus setting and grab starting check whether there
is a keyboard to update the focus state or start grabbing. It makes it
more obvious what to expect, as the call would be a no-op in when no
keyboard is present.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
8916e47d56 wayland/seat: Use seat capability checking helper
https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
94623f475c wayland/keyboard: Cleanup resource list management
Initialize on init(), unlink and reinitialize the list headers on
disable() so that any delayed resource destruction doesn't affect future
state.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
5c4c946f64 wayland/keyboard: Cleanup grab state managing
Initialize on init() and just end grab on disable().

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
2783375f8f wayland/keyboard: Cleanup xkb state managing
Initialize and cleanup properly in a _init()/_destroy() function pair.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
35b8f8c072 wayland/keyboard: Initialize static state in GObject init func
https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
89d22addbd wayland/keyboard: Naming and coding style fixes
Some very long lines that stood out were shortened, and an old naming
convention from weston was removed.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
15a4ad4c38 wayland/keyboard: Scope variable correctly
https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
1c28f85173 wayland/keyboard: Stop using temporary wl_list 'l'
The variable name 'l' usually refers to a GList iterator, but here it's
just a short hand for a specific list. Stop using this shorthand, since
it just makes it harder to read what list is used.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
d8a0275418 wayland/keyboard: Simplify getting the serial serial
Use the MetaWaylandInputDevice helper for getting the next event serial
number.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
aeeffbe1f7 wayland/input-device: Add next serial helper
Add a helper function for getting the next input device serial number.
Will be used by keyboard, pointer and touch devices.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
2016-10-18 13:20:48 +08:00
ac9a113478 MetaIdleMonitorNative: initialize last event timestamp
If this isn't initialized and an idle watch gets instanced before
meta_idle_monitor_native_reset_idletime() gets called, that idle watch
would get triggered as soon as we hit the main loop.

This was causing gnome-session to go into idle mode at session start
thus making gnome-shell lock the screen.

In the past this bug was being masked by either logind emiting
session active signals or a stray input event making it through at
startup.

https://bugzilla.gnome.org/show_bug.cgi?id=772839
2016-10-17 13:48:56 +02:00
5ec5e29422 clutter/stage: Fix framebuffer capture origin offset (again)
Commit 5fbb479301 was wrong too. What we
really want to do here is getting view relative coordinates given the
view's and the rectangle's global coordinates so we need to subtract
the view's origin from the rectangle's.

https://bugzilla.gnome.org/show_bug.cgi?id=771502
2016-10-17 13:48:56 +02:00
95e5786833 MetaWaylandDataSourcePrimary: use the correct parent GType
https://bugzilla.gnome.org/show_bug.cgi?id=771019
2016-10-17 13:48:56 +02:00
325e9d374b Updated Norwegian bokmål translation from Kjartan Maraas. 2016-10-16 19:09:09 +02:00
31043dd58a Updated Norwegian bokmål translation from Kjartan Maraas. 2016-10-16 19:07:02 +02:00
e1685f6ac2 Updated Norwegian bokmål translation. 2016-10-15 17:11:35 +02:00
3071c9efbc Fix typo in Thai translation 2016-10-13 11:23:10 +07:00
302 changed files with 15957 additions and 31464 deletions

1
.gitignore vendored
View File

@ -86,7 +86,6 @@ src/pointer-constraints-unstable-v*-server-protocol.h
src/xdg-foreign-unstable-v*-protocol.c
src/xdg-foreign-unstable-v*-server-protocol.h
src/meta/meta-version.h
src/libmutter-*.pc
doc/reference/*.args
doc/reference/*.bak
doc/reference/*.hierarchy

147
NEWS
View File

@ -1,148 +1,47 @@
3.25.1
3.22.3
======
* Always sync window geometry on state changes [Jonas; #780292]
* Use EGL instead of GLX when drawing using GLES [Jonas; #771636]
* Fix HiDPI detection on vertical monitor layouts [Carlos; #777687]
* Get double-click timing from desktop mouse settings [Armin; #771576]
* Scale relative motion deltas with monitor scale [Jonas, Carlos; #778119]
* Use texture fallback when setting hardware cursor fails [Jente; #770020]
* Fix lock-up when using additional theme variants [Shantanu; #780254]
* Rework low-level monitor configuration [Jonas; #777732]
* Fix building with GLES2 instead of GL [Mario; #781398]
* Misc. bug fixes [Jonas, Piotr, Philip; #780304, #772218, #781242, #781391]
Contributors:
Jonas Ådahl, Philip Chimento, Piotr Drąg, Carlos Garnacho, Shantanu Goel,
Jente Hidskes, Armin Krezović, Rui Matos, Florian Müllner, Mario Sanchez Prada
Translations:
Yuras Shumovich [be], Yosef Or Boczko [he], Tom Tryfonidis [el],
Fabio Tomat [fur], Kukuh Syafaat [id]
3.24.0
======
Translations:
Yuri Myasoedov [ru], Rūdolfs Mazurs [lv], Jordi Mas [ca]
3.23.92
=======
* Properly handle EGLOutput acquire errors [Jonas, Miguel; #779112]
* Fix crash when a window closes during Alt+Tab [Rui; #779483]
* Implement DnD handling code in wayland [Hyungwon; #765003]
* Fix fallout from pixel conversion optimization in 3.23.91 [Carlos; #779234]
* Fix mouse input stopping to work in applications [Carlos; #763246]
* Fix DnD between QT5 and GTK3 applications on wayland [Carlos; #779757]
* Make EDID reading less fragile [Jonas; #779837]
* Add support for tablet grouping [Carlos; #779986]
* Misc. bug fixes and cleanups [Rui, Jonas; #779436, #779001, #779745]
Contributors:
Jonas Ådahl, Miguel A. Vico, Olivier Fourdan, Carlos Garnacho,
Hyungwon Hwang, Rui Matos
Translations:
Chao-Hsiung Liao [zh_TW], Sveinn í Felli [is], Ask Hjorth Larsen [da],
Changwoo Ryu [ko], Aurimas Černius [lt], GNOME Translation Robot [gd],
Marek Černocký [cs], Fran Dieguez [gl], Dušan Kazik [sk]
3.23.91
=======
* Give libinput read-only access to /sys [Carlos; #778472]
* Allow edge-scrolling without 2-finger-scroll capable devices [Rui; #778554]
* Fullscreen windows on the requested monitor on wayland [Rui; #772525]
* Implement threaded swap_event fallback for NVIDIA driver [Owen; #779039]
* Avoid pixel conversions when storing textures from cairo [Carlos; #779234]
* Misc. bug fixes [Piotr, Rui, Florian; #772218, #776919, #778831, #642652]
Contributors:
Piotr Drąg, Carlos Garnacho, Rui Matos, Florian Müllner, Owen W. Taylor
Translations:
Inaki Larranaga Murgoitio [eu], Daniel Mustieles [es], Claude Paroz [fr],
Mario Blättermann [de], Kjartan Maraas [nb], Piotr Drąg [pl],
Andika Triwidada [id], Anders Jonsson [sv], Milo Casagrande [it],
Fabio Tomat [fur], Rafael Fontenelle [pt_BR],
Мирослав Николић [sr, sr@latin], Balázs Meskó [hu], Chao-Hsiung Liao [zh_TW]
3.23.90
=======
* Fix switching between two finger- and edge scrolling on wayland [Rui; #771744]
* Fix frequent freezes in multihead setups on wayland [Rui; #774557]
* Preserve root window mask on XSelectionRequest [Olivier; #776128]
* Fix window menu placement with HiDPI [Jonas; #776055]
* Improve EGLStream support [Jonas; #773629]
* Start moving low-level monitor configuration into mutter [Jonas; #777732]
* Fix HiDPI detection on vertical monitor layouts [Carlos; #777687]
* Fix erroneous key event repeats [Rui; #774989]
* Don't hardcode seat ID in ClutterDeviceManager [Carlos; #778092]
* Fix "ghost" cursors in multi-monitor setups [Jonas; #771056]
* Use eglGetPlatformDisplay [Adam; #772422]
* Fix erratic raise_or_lower behavior [Jose; #705200]
* Fix coordinate mapping of absolute devices [Carlos; #774115]
* Show OSD on tablet mode switches [Carlos; #771098]
* Make mutter libs parallel installable [Jonas; #777317]
* Only apply keymap when not running nested [Jonas; #777800]
* Extend tablet device checks [Carlos; #773779]
* Set right scale for tablet tool cursors on HiDPI [Carlos; #778474]
* Adjust server-side shadows to match Adwaita [Juraj; #744667]
* Misc. bug fixes [Jonas, Bastien, Carlos, Peter, Lionel, Jeremy, Florian;
#774891, #777389, #777691, #778262, #776543, #778684, #778699, #744667]
* Allow edge-scrolling without 2fg-scroll capable devices [Rui; #778554]
* Misc. bug fixes [Jonas, Rui, Carlos, Peter; #771297, #774135, #775986,
#777691, #777470, #778262, #776919]
Contributors:
Jonas Ådahl, Jeremy Bicha, Piotr Drąg, Juraj Fiala, Carlos Garnacho,
Peter Hutterer, Adam Jackson, Lionel Landwerlin, Jose Marino, Rui Matos,
Florian Müllner, Bastien Nocera
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Peter Hutterer, Adam Jackson,
Jose Marino, Rui Matos
Translations:
Kjartan Maraas [nb], Mandy Wang [zh_CN], Marek Černocký [cs],
Anders Jonsson [sv], Dušan Kazik [sk], Piotr Drąg [pl], Matej Urbančič [sl]
Mandy Wang [zh_CN]
3.23.3
3.22.2
======
* Fix frequent freezes in multihead setups on wayland [Rui; #774557]
* Preserve root window mask on XSelectionRequest [Olivier; #776128]
* Misc. bug fixes [Carlos, Florian, Rui, Olivier; #775478, #774891, #775986,
#776036]
Contributors:
Olivier Fourdan, Carlos Garnacho, Rui Matos, Florian Müllner
3.23.2
======
* Stack docks below other windows on fullscreen monitors [Rui; #772937]
* Fix popup grabs blocking screen lock on wayland [Rui; #771235]
* Handle touchpad pinch gestures with more than two fingers [Carlos; #765937]
* Implement drawing tablet support on X11 [Carlos; #773779]
* Fix some Wine games starting minimized [Carlos; #774333]
* Fix switching between two finger- and edge scrolling on wayland [Rui; #771744]
* Implement support for EGLStream/EGLDevice [Jonas; #773629]
* Add size_changed vfunc to handle async client size changes [Rui; #770345]
* Change focus window on clicks with any modifiers [Rui; #746642]
* Misc. bug fixes and cleanups [Carlos, Daniel, Jonas, Rui; #771067, #774330, #774613,
#771297, #774135, #774827, #774923]
Contributors:
Jonas Ådahl, Carlos Garnacho, Rui Matos, Florian Müllner, Daniel Stone
Translations:
Kjartan Maraas [nb]
3.23.1
======
* Fix handling of Escape shortcut in force-quit dialog [Landry; #737109]
* Improve pointer constraints support [Jonas; #771859]
* Really fix framebuffer capture origin offset [Rui; #771502]
* Fix session going into idle mode immediately on startup [Rui; #772839]
* Fix mirror mode with stage views [Rui; #773115]
* Fall back to X with connectors spread across multiple GPUs [Ray; #771442]
* Fix various crashes on wayland [Jonas, Carlos; #771646, #771858, #772929]
* Fix various placement issues on wayland [Olivier, Jonas, Sjoerd; #772729,
#768039, #771841, #771841, #773141]
* Improve pointer constraints support [Jonas; #771859]
* Stack docks below other windows on fullscreen monitors [Rui; #772937]
* Fix switching between two finger- and edge scrolling on wayland [Rui; #771744]
* Fix popup grabs blocking screen lock on wayland [Rui; #771235]
* Fix various crashes on wayland [Jonas; #771646, #771858]
* Fix various placement issues on wayland [Jonas, Sjoerd, Olivier; #768039,
#771841, #773141, #772729]
* Misc. bug fixes [Rui, Jonas, Olivier; #771019, #773116, #772914, #773210]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Rui Matos, Landry MINOZA,
Sjoerd Simons, Ray Strode
Jonas Ådahl, Olivier Fourdan, Rui Matos, Sjoerd Simons
Translations:
Theppitak Karoonboonyanan [th], Kjartan Maraas [nb], Hannie Dumoleyn [nl],
liushuyu [zh_CN]
Theppitak Karoonboonyanan [th], Kjartan Maraas [nb], liushuyu [zh_CN],
YunQiang Su [zh_CN]
3.22.1
======

View File

@ -6,23 +6,16 @@ test -z "$srcdir" && srcdir=.
REQUIRED_AUTOMAKE_VERSION=1.11
olddir="$(pwd)"
cd "${srcdir}"
(test -f configure.ac \
&& test -d src) || {
(test -f $srcdir/configure.ac \
&& test -d $srcdir/src) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level mutter directory"
echo " top-level metacity directory"
exit 1
}
aclocal --install || exit 1
intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install || exit 1
cd "${olddir}"
if [ "$NOCONFIGURE" = "" ]; then
"${srcdir}/configure" "$@" || exit 1
fi
which gnome-autogen.sh || {
echo "You need to install gnome-common from GNOME Subversion (or from"
echo "your distribution's package manager)."
exit 1
}
. gnome-autogen.sh

View File

@ -25,7 +25,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/clutter \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
$(CLUTTER_DEPRECATED_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS) \
$(CLUTTER_HIDDEN_VISIBILITY_CFLAGS) \
@ -37,7 +36,7 @@ AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
INTROSPECTION_GIRS =
# the base include path for headers
clutter_base_includedir = $(includedir)/mutter/clutter-$(LIBMUTTER_API_VERSION)
clutter_base_includedir = $(includedir)/mutter/clutter-$(CLUTTER_API_VERSION)
clutter_includedir = $(clutter_base_includedir)/clutter
clutter_deprecateddir = $(clutter_base_includedir)/clutter/deprecated
@ -113,6 +112,7 @@ source_h = \
clutter-snap-constraint.h \
clutter-stage.h \
clutter-stage-manager.h \
clutter-stage-view.h \
clutter-tap-action.h \
clutter-test-utils.h \
clutter-texture.h \
@ -198,6 +198,7 @@ source_c = \
clutter-snap-constraint.c \
clutter-stage.c \
clutter-stage-manager.c \
clutter-stage-view.c \
clutter-stage-window.c \
clutter-tap-action.c \
clutter-test-utils.c \
@ -239,7 +240,6 @@ source_h_priv = \
clutter-settings-private.h \
clutter-stage-manager-private.h \
clutter-stage-private.h \
clutter-stage-view.h \
clutter-stage-window.h \
$(NULL)
@ -248,7 +248,6 @@ source_c_priv = \
clutter-easing.c \
clutter-event-translator.c \
clutter-id-pool.c \
clutter-stage-view.c \
$(NULL)
# deprecated installed headers
@ -356,7 +355,7 @@ EXTRA_DIST += clutter-version.h.in clutter-version.h
# key symbol update script
EXTRA_DIST += clutter-keysyms-update.pl
pc_files += mutter-clutter-$(LIBMUTTER_API_VERSION).pc
pc_files += mutter-clutter-$(CLUTTER_API_VERSION).pc
# in order to be compatible with Clutter < 1.10, when we shipped a single
# shared library whose name was determined by the single backend it
@ -414,13 +413,11 @@ x11_source_c_priv = \
x11_source_c += \
x11/clutter-device-manager-xi2.c \
x11/clutter-input-device-xi2.c \
x11/clutter-input-device-tool-xi2.c \
$(NULL)
x11_source_h_priv += \
x11/clutter-device-manager-xi2.h \
x11/clutter-input-device-xi2.h \
x11/clutter-input-device-tool-xi2.h \
$(NULL)
x11_source_c += \
@ -442,10 +439,10 @@ x11_introspection = $(x11_source_c) $(x11_source_h)
clutterx11_includedir = $(clutter_includedir)/x11
clutterx11_include_HEADERS = $(x11_source_h)
mutter-clutter-x11-@LIBMUTTER_API_VERSION@.pc: mutter-clutter-$(LIBMUTTER_API_VERSION).pc
mutter-clutter-x11-$(CLUTTER_API_VERSION).pc: mutter-clutter-$(CLUTTER_API_VERSION).pc
$(QUIET_GEN)cp -f $< $(@F)
pc_files += mutter-clutter-x11-$(LIBMUTTER_API_VERSION).pc
pc_files += mutter-clutter-x11-$(CLUTTER_API_VERSION).pc
# Shared cogl backend files
cogl_source_h =
@ -583,17 +580,17 @@ nodist_clutter_include_HEADERS = clutter-config.h $(built_source_h)
clutter_deprecated_HEADERS = $(deprecated_h)
mutterlibdir = $(libdir)/mutter
mutterlib_LTLIBRARIES = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
mutterlib_LTLIBRARIES = libmutter-clutter-@CLUTTER_API_VERSION@.la
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LIBADD = \
libmutter_clutter_@CLUTTER_API_VERSION@_la_LIBADD = \
$(LIBM) \
$(CLUTTER_LIBS) \
$(top_builddir)/../cogl/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la \
$(top_builddir)/../cogl/cogl-pango/libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la \
$(top_builddir)/../cogl/cogl-path/libmutter-cogl-path-$(LIBMUTTER_API_VERSION).la \
$(top_builddir)/../cogl/cogl/libmutter-cogl.la \
$(top_builddir)/../cogl/cogl-pango/libmutter-cogl-pango.la \
$(top_builddir)/../cogl/cogl-path/libmutter-cogl-path.la \
$(NULL)
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
libmutter_clutter_@CLUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_c) \
$(backend_source_h) \
$(backend_source_c_priv) \
@ -611,12 +608,12 @@ libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
$(cally_sources_private) \
$(NULL)
nodist_libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
nodist_libmutter_clutter_@CLUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_built) \
$(built_source_c) \
$(built_source_h)
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
libmutter_clutter_@CLUTTER_API_VERSION@_la_LDFLAGS = \
$(CLUTTER_LINK_FLAGS) \
$(CLUTTER_LT_LDFLAGS) \
-export-dynamic \
@ -630,13 +627,13 @@ install-exec-local:
rm -f $$lib.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION); \
) ; \
(cd $(DESTDIR)$(mutterlibdir) && \
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0 || \
{ rm -f $$lib.0 && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0; }; \
{ ln -s -f libmutter-clutter-$(CLUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0 || \
{ rm -f $$lib.0 && ln -s libmutter-clutter-1.0.so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0; }; \
} \
) ; \
(cd $(DESTDIR)$(mutterlibdir) && \
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib || \
{ rm -f $$lib && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib; }; \
{ ln -s -f libmutter-clutter-$(CLUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib || \
{ rm -f $$lib && ln -s libmutter-clutter-1.0.so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib; }; \
} \
) ; \
done
@ -644,65 +641,59 @@ install-exec-local:
# gobject-introspection rules
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_SCANNER_ARGS = \
--add-include-path=$(top_builddir)/../cogl/cogl \
--add-include-path=$(top_builddir)/../cogl/cogl-pango
INTROSPECTION_COMPILER_ARGS = \
--includedir=$(top_builddir)/../cogl/cogl \
--includedir=$(top_builddir)/../cogl/cogl-pango
INTROSPECTION_SCANNER_ENV = \
PKG_CONFIG_PATH=$(top_builddir)/../cogl/cogl/:$(top_builddir)/../cogl/cogl-pango/:$${PKG_CONFIG_PATH}
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(top_builddir)/../cogl/cogl --add-include-path=$(top_builddir)/../cogl/cogl-pango
INTROSPECTION_COMPILER_ARGS = --includedir=$(top_builddir)/../cogl/cogl --includedir=$(top_builddir)/../cogl/cogl-pango
Clutter-@LIBMUTTER_API_VERSION@.gir: libmutter-clutter-@LIBMUTTER_API_VERSION@.la Makefile
Clutter-@CLUTTER_API_VERSION@.gir: libmutter-clutter-@CLUTTER_API_VERSION@.la Makefile
Clutter_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Clutter
Clutter_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
Clutter_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
Clutter_@LIBMUTTER_API_VERSION@_gir_FILES = \
Clutter_@CLUTTER_API_VERSION_AM@_gir_NAMESPACE = Clutter
Clutter_@CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
Clutter_@CLUTTER_API_VERSION_AM@_gir_LIBS = libmutter-clutter-@CLUTTER_API_VERSION@.la
Clutter_@CLUTTER_API_VERSION_AM@_gir_FILES = \
$(clutter_include_HEADERS) \
$(clutter_deprecated_HEADERS) \
$(nodist_clutter_include_HEADERS) \
$(source_c) \
$(deprecated_c) \
$(built_source_c)
Clutter_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
Clutter_@LIBMUTTER_API_VERSION@_gir_INCLUDES = GL-1.0 GObject-2.0 cairo-1.0 Cogl-@LIBMUTTER_API_VERSION@ CoglPango-@LIBMUTTER_API_VERSION@ Atk-1.0 Json-1.0
Clutter_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
Clutter_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
Clutter_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = GL-1.0 GObject-2.0 cairo-1.0 Cogl-1.0 CoglPango-1.0 Atk-1.0 Json-1.0
Clutter_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--warn-all \
--c-include='clutter/clutter.h' \
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@
--pkg-export=mutter-clutter-@CLUTTER_API_VERSION@
INTROSPECTION_GIRS += Clutter-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += Clutter-@CLUTTER_API_VERSION@.gir
Cally-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
Cally-@CLUTTER_API_VERSION@.gir: Makefile Clutter-@CLUTTER_API_VERSION@.gir
Cally_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Cally
Cally_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
Cally_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
Cally_@LIBMUTTER_API_VERSION@_gir_FILES = $(cally_sources_h) $(cally_sources_c)
Cally_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
Cally_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
Cally_@CLUTTER_API_VERSION_AM@_gir_NAMESPACE = Cally
Cally_@CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
Cally_@CLUTTER_API_VERSION_AM@_gir_LIBS = libmutter-clutter-@CLUTTER_API_VERSION@.la
Cally_@CLUTTER_API_VERSION_AM@_gir_FILES = $(cally_sources_h) $(cally_sources_c)
Cally_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
Cally_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--warn-all \
--c-include='cally/cally.h' \
--pkg-export=mutter-cally-@LIBMUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
--pkg-export=mutter-cally-@CLUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += Cally-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += Cally-@CLUTTER_API_VERSION@.gir
ClutterX11-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
ClutterX11-@CLUTTER_API_VERSION@.gir: Makefile Clutter-@CLUTTER_API_VERSION@.gir
ClutterX11_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = ClutterX11
ClutterX11_@LIBMUTTER_API_VERSION@_gir_INCLUDES = xlib-2.0
ClutterX11_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
ClutterX11_@LIBMUTTER_API_VERSION@_gir_FILES = $(x11_introspection)
ClutterX11_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
ClutterX11_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_NAMESPACE = ClutterX11
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = xlib-2.0
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_LIBS = libmutter-clutter-@CLUTTER_API_VERSION@.la
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_FILES = $(x11_introspection)
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--warn-all \
--c-include='clutter/x11/clutter-x11.h' \
--pkg-export=mutter-clutter-x11-@LIBMUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
--pkg-export=mutter-clutter-x11-@CLUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += ClutterX11-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += ClutterX11-@CLUTTER_API_VERSION@.gir
# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
# install anything - we need to install inside our prefix.

View File

@ -43,9 +43,10 @@ $(marshal_h): stamp-marshal
@true
$(marshal_c): $(marshal_h)
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
$(AM_V_GEN)(echo "#include \"$(marshal_h)\"" ; \
$(GLIB_GENMARSHAL) \
--prefix=$(glib_marshal_prefix) \
--body \
$(marshal_list) > xgen-mc \
&& (cmp -s xgen-mc $(marshal_c) || cp -f xgen-mc $(marshal_c)) \
$(marshal_list)) > xgen-mc \
&& cp xgen-mc $(marshal_c) \
&& rm -f xgen-mc

View File

@ -781,7 +781,7 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
"position of the stage");
}
else
#endif
#else
{
static gboolean yet_warned = FALSE;
@ -793,6 +793,7 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
"atk_component_get_extents() with ATK_XY_SCREEN.");
}
}
#endif
if (xp)
*xp = x;

View File

@ -283,6 +283,9 @@ void _clutter_actor_queue_redraw_full
ClutterPaintVolume *volume,
ClutterEffect *effect);
ClutterPaintVolume * _clutter_actor_get_queue_redraw_clip (ClutterActor *self);
void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,
ClutterPaintVolume *clip_volume);
void _clutter_actor_finish_queue_redraw (ClutterActor *self,
ClutterPaintVolume *clip);

View File

@ -840,7 +840,6 @@ struct _ClutterActorPrivate
guint needs_compute_expand : 1;
guint needs_x_expand : 1;
guint needs_y_expand : 1;
guint needs_paint_volume_update : 1;
};
enum
@ -2620,7 +2619,6 @@ clutter_actor_real_allocate (ClutterActor *self,
g_object_freeze_notify (G_OBJECT (self));
changed = clutter_actor_set_allocation_internal (self, box, flags);
priv->needs_paint_volume_update = changed;
/* we allocate our children before we notify changes in our geometry,
* so that people connecting to properties will be able to get valid
@ -2643,12 +2641,9 @@ clutter_actor_real_allocate (ClutterActor *self,
}
static void
_clutter_actor_propagate_queue_redraw (ClutterActor *self,
ClutterActor *origin,
ClutterPaintVolume *pv)
_clutter_actor_signal_queue_redraw (ClutterActor *self,
ClutterActor *origin)
{
gboolean stop = FALSE;
/* no point in queuing a redraw on a destroyed actor */
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
return;
@ -2657,33 +2652,19 @@ _clutter_actor_propagate_queue_redraw (ClutterActor *self,
* the actor bas been cloned. In this case the clone will need to
* receive the signal so it can queue its own redraw.
*/
while (self)
{
_clutter_actor_queue_redraw_on_clones (self);
/* calls klass->queue_redraw in default handler */
if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW],
0, TRUE))
{
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin, pv, &stop);
}
else
{
stop = CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin, pv);
}
_clutter_actor_queue_redraw_on_clones (self);
if (stop)
break;
self = clutter_actor_get_parent (self);
}
/* calls klass->queue_redraw in default handler */
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin);
}
static gboolean
clutter_actor_real_queue_redraw (ClutterActor *self,
ClutterActor *origin,
ClutterPaintVolume *paint_volume)
static void
clutter_actor_real_queue_redraw (ClutterActor *self,
ClutterActor *origin)
{
ClutterActor *parent;
CLUTTER_NOTE (PAINT, "Redraw queued on '%s' (from: '%s')",
_clutter_actor_get_debug_name (self),
origin != NULL ? _clutter_actor_get_debug_name (origin)
@ -2691,14 +2672,13 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
/* no point in queuing a redraw on a destroyed actor */
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
return TRUE;
return;
/* If the queue redraw is coming from a child then the actor has
become dirty and any queued effect is no longer valid */
if (self != origin)
{
self->priv->is_dirty = TRUE;
self->priv->needs_paint_volume_update = TRUE;
self->priv->effect_to_redraw = NULL;
}
@ -2707,7 +2687,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
* won't change so we don't have to propagate up the hierarchy.
*/
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
return TRUE;
return;
/* Although we could determine here that a full stage redraw
* has already been queued and immediately bail out, we actually
@ -2721,7 +2701,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
if (stage != NULL &&
_clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage)))
return TRUE;
return;
}
self->priv->propagated_one_redraw = TRUE;
@ -2729,7 +2709,12 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
/* notify parents, if they are all visible eventually we'll
* queue redraw on the stage, which queues the redraw idle.
*/
return FALSE;
parent = clutter_actor_get_parent (self);
if (parent != NULL)
{
/* this will go up recursively */
_clutter_actor_signal_queue_redraw (parent, origin);
}
}
static void
@ -4030,11 +4015,7 @@ clutter_actor_continue_paint (ClutterActor *self)
clutter_paint_node_unref (dummy);
/* XXX:2.0 - Call the paint() virtual directly */
if (g_signal_has_handler_pending (self, actor_signals[PAINT],
0, TRUE))
g_signal_emit (self, actor_signals[PAINT], 0);
else
CLUTTER_ACTOR_GET_CLASS (self)->paint (self);
g_signal_emit (self, actor_signals[PAINT], 0);
}
else
{
@ -4048,11 +4029,7 @@ clutter_actor_continue_paint (ClutterActor *self)
*
* XXX:2.0 - Call the pick() virtual directly
*/
if (g_signal_has_handler_pending (self, actor_signals[PICK],
0, TRUE))
g_signal_emit (self, actor_signals[PICK], 0, &col);
else
CLUTTER_ACTOR_GET_CLASS (self)->pick (self, &col);
g_signal_emit (self, actor_signals[PICK], 0, &col);
}
}
else
@ -4835,8 +4812,7 @@ clutter_actor_set_scale_factor (ClutterActor *self,
g_assert (pspec != NULL);
g_assert (scale_p != NULL);
if (*scale_p != factor)
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
}
static inline void
@ -8018,12 +7994,10 @@ clutter_actor_class_init (ClutterActorClass *klass)
G_SIGNAL_RUN_LAST |
G_SIGNAL_NO_HOOKS,
G_STRUCT_OFFSET (ClutterActorClass, queue_redraw),
g_signal_accumulator_true_handled,
NULL,
_clutter_marshal_BOOLEAN__OBJECT_BOXED,
G_TYPE_BOOLEAN, 2,
CLUTTER_TYPE_ACTOR,
CLUTTER_TYPE_PAINT_VOLUME);
NULL, NULL,
_clutter_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
CLUTTER_TYPE_ACTOR);
/**
* ClutterActor::queue-relayout:
@ -8528,7 +8502,6 @@ clutter_actor_init (ClutterActor *self)
priv->needs_width_request = TRUE;
priv->needs_height_request = TRUE;
priv->needs_allocation = TRUE;
priv->needs_paint_volume_update = TRUE;
priv->cached_width_age = 1;
priv->cached_height_age = 1;
@ -8622,7 +8595,8 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
ClutterPaintVolume *clip)
{
ClutterActorPrivate *priv = self->priv;
ClutterPaintVolume *pv = NULL;
ClutterPaintVolume *pv;
gboolean clipped;
/* Remove queue entry early in the process, otherwise a new
queue_redraw() during signal handling could put back this
@ -8649,7 +8623,8 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
*/
if (clip)
{
pv = clip;
_clutter_actor_set_queue_redraw_clip (self, clip);
clipped = TRUE;
}
else if (G_LIKELY (priv->last_paint_volume_valid))
{
@ -8659,12 +8634,36 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
/* make sure we redraw the actors old position... */
_clutter_actor_propagate_queue_redraw (stage, stage,
&priv->last_paint_volume);
}
}
_clutter_actor_set_queue_redraw_clip (stage,
&priv->last_paint_volume);
_clutter_actor_signal_queue_redraw (stage, stage);
_clutter_actor_set_queue_redraw_clip (stage, NULL);
_clutter_actor_propagate_queue_redraw (self, self, pv);
/* XXX: Ideally the redraw signal would take a clip volume
* argument, but that would be an ABI break. Until we can
* break the ABI we pass the argument out-of-band
*/
/* setup the clip for the actors new position... */
_clutter_actor_set_queue_redraw_clip (self, pv);
clipped = TRUE;
}
else
clipped = FALSE;
}
else
clipped = FALSE;
_clutter_actor_signal_queue_redraw (self, self);
/* Just in case anyone is manually firing redraw signals without
* using the public queue_redraw() API we are careful to ensure that
* our out-of-band clip member is cleared before returning...
*
* Note: A NULL clip denotes a full-stage, un-clipped redraw
*/
if (G_LIKELY (clipped))
_clutter_actor_set_queue_redraw_clip (self, NULL);
}
static void
@ -8825,7 +8824,8 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
{
/* NB: NULL denotes an undefined clip which will result in a
* full redraw... */
_clutter_actor_propagate_queue_redraw (self, self, NULL);
_clutter_actor_set_queue_redraw_clip (self, NULL);
_clutter_actor_signal_queue_redraw (self, self);
return;
}
@ -8899,7 +8899,6 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
}
priv->is_dirty = TRUE;
priv->needs_paint_volume_update = TRUE;
}
/**
@ -10248,10 +10247,9 @@ clutter_actor_set_position (ClutterActor *self,
cur_position.x = clutter_actor_get_x (self);
cur_position.y = clutter_actor_get_y (self);
if (!clutter_point_equals (&cur_position, &new_position))
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
&cur_position,
&new_position);
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
&cur_position,
&new_position);
}
/**
@ -12957,7 +12955,6 @@ clutter_actor_add_child_internal (ClutterActor *self,
child->priv->needs_width_request = TRUE;
child->priv->needs_height_request = TRUE;
child->priv->needs_allocation = TRUE;
child->priv->needs_paint_volume_update = TRUE;
/* we only queue a relayout here, because any possible
* redraw has already been queued either by show() or
@ -16635,6 +16632,26 @@ clutter_actor_has_pointer (ClutterActor *self)
return self->priv->has_pointer;
}
/* XXX: This is a workaround for not being able to break the ABI of
* the QUEUE_REDRAW signal. It is an out-of-band argument. See
* clutter_actor_queue_clipped_redraw() for details.
*/
ClutterPaintVolume *
_clutter_actor_get_queue_redraw_clip (ClutterActor *self)
{
return g_object_get_data (G_OBJECT (self),
"-clutter-actor-queue-redraw-clip");
}
void
_clutter_actor_set_queue_redraw_clip (ClutterActor *self,
ClutterPaintVolume *clip)
{
g_object_set_data (G_OBJECT (self),
"-clutter-actor-queue-redraw-clip",
clip);
}
/**
* clutter_actor_has_allocation:
* @self: a #ClutterActor
@ -17481,22 +17498,16 @@ _clutter_actor_get_paint_volume_mutable (ClutterActor *self)
priv = self->priv;
if (priv->paint_volume_valid)
{
if (!priv->needs_paint_volume_update)
return &priv->paint_volume;
clutter_paint_volume_free (&priv->paint_volume);
}
clutter_paint_volume_free (&priv->paint_volume);
if (_clutter_actor_get_paint_volume_real (self, &priv->paint_volume))
{
priv->paint_volume_valid = TRUE;
priv->needs_paint_volume_update = FALSE;
return &priv->paint_volume;
}
else
{
priv->paint_volume_valid = FALSE;
priv->needs_paint_volume_update = FALSE;
return NULL;
}
}

View File

@ -236,9 +236,8 @@ struct _ClutterActorClass
void (* pick) (ClutterActor *actor,
const ClutterColor *color);
gboolean (* queue_redraw) (ClutterActor *actor,
ClutterActor *leaf_that_queued,
ClutterPaintVolume *paint_volume);
void (* queue_redraw) (ClutterActor *actor,
ClutterActor *leaf_that_queued);
/* size negotiation */
void (* get_preferred_width) (ClutterActor *self,

View File

@ -76,6 +76,9 @@ struct _ClutterCanvasPrivate
gboolean dirty;
CoglBitmap *buffer;
int scale_factor;
guint scale_factor_set : 1;
};
enum
@ -84,6 +87,8 @@ enum
PROP_WIDTH,
PROP_HEIGHT,
PROP_SCALE_FACTOR,
PROP_SCALE_FACTOR_SET,
LAST_PROP
};
@ -180,6 +185,11 @@ clutter_canvas_set_property (GObject *gobject,
}
break;
case PROP_SCALE_FACTOR:
clutter_canvas_set_scale_factor (CLUTTER_CANVAS (gobject),
g_value_get_int (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
@ -204,6 +214,17 @@ clutter_canvas_get_property (GObject *gobject,
g_value_set_int (value, priv->height);
break;
case PROP_SCALE_FACTOR:
if (priv->scale_factor_set)
g_value_set_int (value, priv->scale_factor);
else
g_value_set_int (value, -1);
break;
case PROP_SCALE_FACTOR_SET:
g_value_set_boolean (value, priv->scale_factor_set);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
@ -247,6 +268,46 @@ clutter_canvas_class_init (ClutterCanvasClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* ClutterCanvas:scale-factor-set:
*
* Whether the #ClutterCanvas:scale-factor property is set.
*
* If the #ClutterCanvas:scale-factor-set property is %FALSE
* then #ClutterCanvas will use the #ClutterSettings:window-scaling-factor
* property.
*
* Since: 1.18
*/
obj_props[PROP_SCALE_FACTOR_SET] =
g_param_spec_boolean ("scale-factor-set",
P_("Scale Factor Set"),
P_("Whether the scale-factor property is set"),
FALSE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
* ClutterCanvas:scale-factor:
*
* The scaling factor to be applied to the Cairo surface used for
* drawing.
*
* If #ClutterCanvas:scale-factor is set to a negative value, the
* value of the #ClutterSettings:window-scaling-factor property is
* used instead.
*
* Use #ClutterCanvas:scale-factor-set to check if the scale factor
* is set.
*
* Since: 1.18
*/
obj_props[PROP_SCALE_FACTOR] =
g_param_spec_int ("scale-factor",
P_("Scale Factor"),
P_("The scaling factor for the surface"),
-1, 1000,
-1,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* ClutterCanvas::draw:
@ -293,6 +354,7 @@ clutter_canvas_init (ClutterCanvas *self)
self->priv->width = -1;
self->priv->height = -1;
self->priv->scale_factor = -1;
}
static void
@ -335,6 +397,7 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
gboolean mapped_buffer;
unsigned char *data;
CoglBuffer *buffer;
int window_scale = 1;
gboolean res;
cairo_t *cr;
@ -342,11 +405,20 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
priv->dirty = TRUE;
real_width = priv->width;
real_height = priv->height;
if (priv->scale_factor_set)
window_scale = priv->scale_factor;
else
g_object_get (clutter_settings_get_default (),
"window-scaling-factor", &window_scale,
NULL);
CLUTTER_NOTE (MISC, "Creating Cairo surface with size %d x %d",
priv->width, priv->height);
real_width = priv->width * window_scale;
real_height = priv->height * window_scale;
CLUTTER_NOTE (MISC, "Creating Cairo surface with size %d x %d (real: %d x %d, scale: %d)",
priv->width, priv->height,
real_width, real_height,
window_scale);
if (priv->buffer == NULL)
{
@ -389,6 +461,8 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
mapped_buffer = FALSE;
}
cairo_surface_set_device_scale (surface, window_scale, window_scale);
self->priv->cr = cr = cairo_create (surface);
g_signal_emit (self, canvas_signals[DRAW], 0,
@ -562,3 +636,81 @@ clutter_canvas_set_size (ClutterCanvas *canvas,
return clutter_canvas_invalidate_internal (canvas, width, height);
}
/**
* clutter_canvas_set_scale_factor:
* @canvas: a #ClutterCanvas
* @scale: the scale factor, or -1 for the default
*
* Sets the scaling factor for the Cairo surface used by @canvas.
*
* This function should rarely be used.
*
* The default scaling factor of a #ClutterCanvas content uses the
* #ClutterSettings:window-scaling-factor property, which is set by
* the windowing system. By using this function it is possible to
* override that setting.
*
* Changing the scale factor will invalidate the @canvas.
*
* Since: 1.18
*/
void
clutter_canvas_set_scale_factor (ClutterCanvas *canvas,
int scale)
{
ClutterCanvasPrivate *priv;
GObject *obj;
g_return_if_fail (CLUTTER_IS_CANVAS (canvas));
g_return_if_fail (scale != 0);
priv = canvas->priv;
if (scale < 0)
{
if (!priv->scale_factor_set)
return;
priv->scale_factor_set = FALSE;
priv->scale_factor = -1;
}
else
{
if (priv->scale_factor_set && priv->scale_factor == scale)
return;
priv->scale_factor_set = TRUE;
priv->scale_factor = scale;
}
clutter_content_invalidate (CLUTTER_CONTENT (canvas));
obj = G_OBJECT (canvas);
g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_FACTOR]);
g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_FACTOR_SET]);
}
/**
* clutter_canvas_get_scale_factor:
* @canvas: a #ClutterCanvas
*
* Retrieves the scaling factor of @canvas, as set using
* clutter_canvas_set_scale_factor().
*
* Return value: the scaling factor, or -1 if the @canvas
* uses the default from #ClutterSettings
*
* Since: 1.18
*/
int
clutter_canvas_get_scale_factor (ClutterCanvas *canvas)
{
g_return_val_if_fail (CLUTTER_IS_CANVAS (canvas), -1);
if (!canvas->priv->scale_factor_set)
return -1;
return canvas->priv->scale_factor;
}

View File

@ -54,7 +54,6 @@
struct _ClutterClonePrivate
{
ClutterActor *clone_source;
gulong source_destroy_id;
};
G_DEFINE_TYPE_WITH_PRIVATE (ClutterClone, clutter_clone, CLUTTER_TYPE_ACTOR)
@ -377,13 +376,6 @@ clutter_clone_new (ClutterActor *source)
return g_object_new (CLUTTER_TYPE_CLONE, "source", source, NULL);
}
static void
on_source_destroyed (ClutterActor *source,
ClutterClone *self)
{
clutter_clone_set_source_internal (self, NULL);
}
static void
clutter_clone_set_source_internal (ClutterClone *self,
ClutterActor *source)
@ -395,8 +387,6 @@ clutter_clone_set_source_internal (ClutterClone *self,
if (priv->clone_source != NULL)
{
g_signal_handler_disconnect (priv->clone_source, priv->source_destroy_id);
priv->source_destroy_id = 0;
_clutter_actor_detach_clone (priv->clone_source, CLUTTER_ACTOR (self));
g_object_unref (priv->clone_source);
priv->clone_source = NULL;
@ -406,8 +396,6 @@ clutter_clone_set_source_internal (ClutterClone *self,
{
priv->clone_source = g_object_ref (source);
_clutter_actor_attach_clone (priv->clone_source, CLUTTER_ACTOR (self));
priv->source_destroy_id = g_signal_connect (priv->clone_source, "destroy",
G_CALLBACK (on_source_destroyed), self);
}
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_SOURCE]);

View File

@ -48,7 +48,7 @@
#include "clutter-debug.h"
/* XXX - keep in sync with the ClutterStaticColor enumeration order */
static const ClutterColor static_colors[] = {
static const ClutterColor const static_colors[] = {
/* CGA/EGA color palette */
{ 0xff, 0xff, 0xff, 0xff }, /* white */
{ 0x00, 0x00, 0x00, 0xff }, /* black */

View File

@ -154,15 +154,6 @@ struct _ClutterInputDeviceClass
guint *evdev_keycode);
void (* update_from_tool) (ClutterInputDevice *device,
ClutterInputDeviceTool *tool);
gboolean (* is_mode_switch_button) (ClutterInputDevice *device,
guint group,
guint button);
gint (* get_group_n_modes) (ClutterInputDevice *device,
gint group);
gboolean (* is_grouped) (ClutterInputDevice *device,
ClutterInputDevice *other_device);
};
/* Platform-dependent interface */

View File

@ -48,7 +48,6 @@
#include "clutter-private.h"
#include "clutter-stage-private.h"
#include "clutter-virtual-input-device.h"
#include "clutter-input-device-tool.h"
struct _ClutterDeviceManagerPrivate
{
@ -71,7 +70,6 @@ enum
{
DEVICE_ADDED,
DEVICE_REMOVED,
TOOL_CHANGED,
LAST_SIGNAL
};
@ -186,16 +184,6 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
_clutter_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
CLUTTER_TYPE_INPUT_DEVICE);
manager_signals[TOOL_CHANGED] =
g_signal_new (I_("tool-changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
_clutter_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2,
CLUTTER_TYPE_INPUT_DEVICE,
CLUTTER_TYPE_INPUT_DEVICE_TOOL);
}
static void

View File

@ -83,7 +83,7 @@ struct _ClutterDeviceManagerClass
ClutterInputDevice *device);
void (* select_stage_events) (ClutterDeviceManager *manager,
ClutterStage *stage);
ClutterVirtualInputDevice *(* create_virtual_device) (ClutterDeviceManager *device_manager,
ClutterVirtualInputDevice *(* create_virtual_device) (ClutterDeviceManager *manager,
ClutterInputDeviceType device_type);
void (* compress_motion) (ClutterDeviceManager *device_manger,
ClutterEvent *event,

View File

@ -1990,28 +1990,22 @@ clutter_event_remove_filter (guint id)
}
/**
* clutter_event_get_touchpad_gesture_finger_count:
* @event: a touchpad swipe/pinch event
* clutter_event_get_gesture_swipe_finger_count:
* @event: a touchpad swipe event
*
* Returns the number of fingers that is triggering the touchpad gesture.
*
* Returns: the number of fingers in the gesture.
* Returns: the number of fingers swiping.
*
* Since: 1.24
**/
guint
clutter_event_get_touchpad_gesture_finger_count (const ClutterEvent *event)
clutter_event_get_gesture_swipe_finger_count (const ClutterEvent *event)
{
g_return_val_if_fail (event != NULL, 0);
g_return_val_if_fail (event->type == CLUTTER_TOUCHPAD_SWIPE ||
event->type == CLUTTER_TOUCHPAD_PINCH, 0);
g_return_val_if_fail (event->type == CLUTTER_TOUCHPAD_SWIPE, 0);
if (event->type == CLUTTER_TOUCHPAD_SWIPE)
return event->touchpad_swipe.n_fingers;
else if (event->type == CLUTTER_TOUCHPAD_PINCH)
return event->touchpad_pinch.n_fingers;
return 0;
return event->touchpad_swipe.n_fingers;
}
/**

View File

@ -459,7 +459,6 @@ struct _ClutterTouchpadPinchEvent
gfloat dy;
gfloat angle_delta;
gfloat scale;
guint n_fingers;
};
/**
@ -508,7 +507,6 @@ struct _ClutterPadButtonEvent
guint32 button;
guint32 group;
ClutterInputDevice *device;
guint32 mode;
};
struct _ClutterPadStripEvent
@ -524,7 +522,6 @@ struct _ClutterPadStripEvent
guint32 strip_number;
guint32 group;
gdouble value;
guint32 mode;
};
struct _ClutterPadRingEvent
@ -540,7 +537,6 @@ struct _ClutterPadRingEvent
guint32 ring_number;
guint32 group;
gdouble angle;
guint32 mode;
};
/**
@ -756,7 +752,7 @@ CLUTTER_AVAILABLE_IN_1_2
const ClutterEvent * clutter_get_current_event (void);
CLUTTER_AVAILABLE_IN_1_24
guint clutter_event_get_touchpad_gesture_finger_count (const ClutterEvent *event);
guint clutter_event_get_gesture_swipe_finger_count (const ClutterEvent *event);
CLUTTER_AVAILABLE_IN_1_24
gdouble clutter_event_get_gesture_pinch_angle_delta (const ClutterEvent *event);

View File

@ -2175,63 +2175,6 @@ clutter_input_device_get_n_mode_groups (ClutterInputDevice *device)
return device->n_mode_groups;
}
gint
clutter_input_device_get_group_n_modes (ClutterInputDevice *device,
gint group)
{
ClutterInputDeviceClass *device_class;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
CLUTTER_PAD_DEVICE, 0);
g_return_val_if_fail (group >= 0, 0);
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
if (device_class->get_group_n_modes)
return device_class->get_group_n_modes (device, group);
return 0;
}
gboolean
clutter_input_device_is_mode_switch_button (ClutterInputDevice *device,
guint group,
guint button)
{
ClutterInputDeviceClass *device_class;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
CLUTTER_PAD_DEVICE, FALSE);
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
if (device_class->is_mode_switch_button)
return device_class->is_mode_switch_button (device, group, button);
return FALSE;
}
gint
clutter_input_device_get_mode_switch_button_group (ClutterInputDevice *device,
guint button)
{
gint group;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), -1);
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
CLUTTER_PAD_DEVICE, -1);
for (group = 0; group < device->n_mode_groups; group++)
{
if (clutter_input_device_is_mode_switch_button (device, group, button))
return group;
}
return -1;
}
const gchar *
clutter_input_device_get_device_node (ClutterInputDevice *device)
{
@ -2266,13 +2209,3 @@ clutter_input_device_set_mapping_mode (ClutterInputDevice *device,
device->mapping_mode = mapping;
g_object_notify (G_OBJECT (device), "mapping-mode");
}
gboolean
clutter_input_device_is_grouped (ClutterInputDevice *device,
ClutterInputDevice *other_device)
{
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (other_device), FALSE);
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
}

View File

@ -147,18 +147,6 @@ gint clutter_input_device_get_n_strips (ClutterInputDev
CLUTTER_AVAILABLE_IN_ALL
gint clutter_input_device_get_n_mode_groups (ClutterInputDevice *device);
CLUTTER_AVAILABLE_IN_ALL
gint clutter_input_device_get_group_n_modes (ClutterInputDevice *device,
gint group);
CLUTTER_AVAILABLE_IN_ALL
gboolean clutter_input_device_is_mode_switch_button (ClutterInputDevice *device,
guint group,
guint button);
CLUTTER_AVAILABLE_IN_ALL
gint clutter_input_device_get_mode_switch_button_group (ClutterInputDevice *device,
guint button);
CLUTTER_AVAILABLE_IN_ALL
const gchar * clutter_input_device_get_device_node (ClutterInputDevice *device);
@ -168,9 +156,6 @@ ClutterInputDeviceMapping clutter_input_device_get_mapping_mode (ClutterInputDev
CLUTTER_AVAILABLE_IN_ALL
void clutter_input_device_set_mapping_mode (ClutterInputDevice *device,
ClutterInputDeviceMapping mapping);
CLUTTER_AVAILABLE_IN_ALL
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
ClutterInputDevice *other_device);
G_END_DECLS

View File

@ -1,7 +1,6 @@
BOOLEAN:BOXED
BOOLEAN:BOXED,INT,INT
BOOLEAN:OBJECT,BOOLEAN
BOOLEAN:OBJECT,BOXED
BOOLEAN:OBJECT,BOXED,DOUBLE
BOOLEAN:OBJECT,DOUBLE
BOOLEAN:OBJECT,ENUM
@ -18,14 +17,12 @@ VOID:BOXED,FLAGS
VOID:INT
VOID:INT64,INT64,FLOAT,BOOLEAN
VOID:INT,INT
VOID:INT,POINTER
VOID:FLOAT,FLOAT
VOID:INT,INT,INT,INT
VOID:OBJECT
VOID:OBJECT,FLAGS
VOID:OBJECT,FLOAT,FLOAT
VOID:OBJECT,FLOAT,FLOAT,FLAGS
VOID:OBJECT,OBJECT
VOID:OBJECT,PARAM
VOID:OBJECT,POINTER
VOID:OBJECT,UINT

View File

@ -1166,21 +1166,6 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
_clutter_paint_volume_get_bounding_box (&projected_pv, box);
if (pv->is_2d && pv->actor &&
clutter_actor_get_z_position (pv->actor) == 0)
{
/* If the volume/actor are perfectly 2D, take the bounding box as
* good. We won't need to add any extra room for sub-pixel positioning
* in this case.
*/
clutter_paint_volume_free (&projected_pv);
box->x1 = CLUTTER_NEARBYINT (box->x1);
box->y1 = CLUTTER_NEARBYINT (box->y1);
box->x2 = CLUTTER_NEARBYINT (box->x2);
box->y2 = CLUTTER_NEARBYINT (box->y2);
return;
}
/* The aim here is that for a given rectangle defined with floating point
* coordinates we want to determine a stable quantized size in pixels
* that doesn't vary due to the original box's sub-pixel position.

View File

@ -77,7 +77,9 @@ struct _ClutterSettings
guint password_hint_time;
gint window_scaling_factor;
gint unscaled_font_dpi;
guint fixed_scaling_factor : 1;
};
struct _ClutterSettingsClass
@ -110,6 +112,7 @@ enum
PROP_PASSWORD_HINT_TIME,
PROP_WINDOW_SCALING_FACTOR,
PROP_UNSCALED_FONT_DPI,
PROP_LAST
@ -352,6 +355,14 @@ clutter_settings_set_property (GObject *gobject,
self->password_hint_time = g_value_get_uint (value);
break;
case PROP_WINDOW_SCALING_FACTOR:
if (!self->fixed_scaling_factor)
{
self->window_scaling_factor = g_value_get_int (value);
self->fixed_scaling_factor = TRUE;
}
break;
case PROP_UNSCALED_FONT_DPI:
self->font_dpi = g_value_get_int (value);
settings_update_resolution (self);
@ -371,7 +382,14 @@ clutter_settings_set_property_internal (ClutterSettings *self,
property = g_intern_string (property);
if (property == I_("window-scaling-factor") &&
self->fixed_scaling_factor)
return;
g_object_set_property (G_OBJECT (self), property, value);
if (property == I_("window-scaling-factor"))
self->fixed_scaling_factor = FALSE;
}
static void
@ -428,6 +446,10 @@ clutter_settings_get_property (GObject *gobject,
g_value_set_uint (value, self->password_hint_time);
break;
case PROP_WINDOW_SCALING_FACTOR:
g_value_set_int (value, self->window_scaling_factor);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
@ -655,6 +677,14 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
500,
CLUTTER_PARAM_READWRITE);
obj_props[PROP_WINDOW_SCALING_FACTOR] =
g_param_spec_int ("window-scaling-factor",
P_("Window Scaling Factor"),
P_("The scaling factor to be applied to windows"),
1, G_MAXINT,
1,
CLUTTER_PARAM_READWRITE);
obj_props[PROP_FONTCONFIG_TIMESTAMP] =
g_param_spec_uint ("fontconfig-timestamp",
P_("Fontconfig configuration timestamp"),
@ -692,6 +722,8 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
static void
clutter_settings_init (ClutterSettings *self)
{
const char *scale_str;
self->resolution = -1.0;
self->font_dpi = -1;
@ -710,6 +742,18 @@ clutter_settings_init (ClutterSettings *self)
self->xft_rgba = NULL;
self->long_press_duration = 500;
/* if the scaling factor was set by the environment we ignore
* any explicit setting
*/
scale_str = g_getenv ("CLUTTER_SCALE");
if (scale_str != NULL)
{
self->window_scaling_factor = atol (scale_str);
self->fixed_scaling_factor = TRUE;
}
else
self->window_scaling_factor = 1;
}
/**

View File

@ -28,7 +28,6 @@ enum
PROP_LAYOUT,
PROP_FRAMEBUFFER,
PROP_OFFSCREEN,
PROP_SCALE,
PROP_LAST
};
@ -38,7 +37,6 @@ static GParamSpec *obj_props[PROP_LAST];
typedef struct _ClutterStageViewPrivate
{
cairo_rectangle_int_t layout;
int scale;
CoglFramebuffer *framebuffer;
CoglOffscreen *offscreen;
@ -143,15 +141,6 @@ clutter_stage_view_blit_offscreen (ClutterStageView *view,
cogl_framebuffer_pop_matrix (priv->framebuffer);
}
int
clutter_stage_view_get_scale (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
return priv->scale;
}
gboolean
clutter_stage_view_is_dirty_viewport (ClutterStageView *view)
{
@ -190,24 +179,16 @@ clutter_stage_view_set_dirty_projection (ClutterStageView *view,
priv->dirty_projection = dirty;
}
void
clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
CoglMatrix *matrix)
{
ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view);
view_class->get_offscreen_transformation_matrix (view, matrix);
}
void
clutter_stage_view_transform_to_onscreen (ClutterStageView *view,
gfloat *x,
gfloat *y)
{
ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view);
gfloat z = 0, w = 1;
CoglMatrix matrix;
clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix);
view_class->get_offscreen_transformation_matrix (view, &matrix);
cogl_matrix_get_inverse (&matrix, &matrix);
cogl_matrix_transform_point (&matrix, x, y, &z, &w);
}
@ -240,9 +221,6 @@ clutter_stage_view_get_property (GObject *object,
case PROP_OFFSCREEN:
g_value_set_boxed (value, priv->offscreen);
break;
case PROP_SCALE:
g_value_set_int (value, priv->scale);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@ -271,9 +249,6 @@ clutter_stage_view_set_property (GObject *object,
case PROP_OFFSCREEN:
priv->offscreen = g_value_dup_boxed (value);
break;
case PROP_SCALE:
priv->scale = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@ -301,7 +276,6 @@ clutter_stage_view_init (ClutterStageView *view)
priv->dirty_viewport = TRUE;
priv->dirty_projection = TRUE;
priv->scale = 1;
}
static void
@ -341,13 +315,5 @@ clutter_stage_view_class_init (ClutterStageViewClass *klass)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
obj_props[PROP_SCALE] =
g_param_spec_int ("scale",
"View scale",
"The view scale",
1, G_MAXINT, 1,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
}

View File

@ -60,9 +60,6 @@ void clutter_stage_view_transform_to_onscreen (ClutterStageView *vie
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
const cairo_rectangle_int_t *clip);
CLUTTER_AVAILABLE_IN_MUTTER
int clutter_stage_view_get_scale (ClutterStageView *view);
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
@ -73,8 +70,4 @@ gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
gboolean dirty);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
CoglMatrix *matrix);
#endif /* __CLUTTER_STAGE_VIEW_H__ */

View File

@ -231,35 +231,19 @@ _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
return TRUE;
}
cairo_region_t *
_clutter_stage_window_get_redraw_clip (ClutterStageWindow *window)
gboolean
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
cairo_rectangle_int_t *stage_clip)
{
ClutterStageWindowIface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->get_redraw_clip != NULL)
return iface->get_redraw_clip (window);
if (iface->get_redraw_clip_bounds != NULL)
return iface->get_redraw_clip_bounds (window, stage_clip);
return NULL;
}
gboolean
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
cairo_rectangle_int_t *stage_clip)
{
cairo_region_t *redraw_clip;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
redraw_clip = _clutter_stage_window_get_redraw_clip (window);
if (!redraw_clip)
return FALSE;
cairo_region_get_extents (redraw_clip, stage_clip);
cairo_region_destroy (redraw_clip);
return TRUE;
return FALSE;
}
void
@ -319,6 +303,33 @@ _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
return FALSE;
}
void
_clutter_stage_window_set_scale_factor (ClutterStageWindow *window,
int factor)
{
ClutterStageWindowIface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_scale_factor != NULL)
iface->set_scale_factor (window, factor);
}
int
_clutter_stage_window_get_scale_factor (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 1);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->get_scale_factor != NULL)
return iface->get_scale_factor (window);
return 1;
}
GList *
_clutter_stage_window_get_views (ClutterStageWindow *window)
{

View File

@ -68,7 +68,9 @@ struct _ClutterStageWindowIface
cairo_rectangle_int_t *stage_rectangle);
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
cairo_region_t * (* get_redraw_clip) (ClutterStageWindow *stage_window);
gboolean (* get_redraw_clip_bounds) (ClutterStageWindow *stage_window,
cairo_rectangle_int_t *clip);
void (* set_accept_focus) (ClutterStageWindow *stage_window,
gboolean accept_focus);
@ -81,6 +83,9 @@ struct _ClutterStageWindowIface
gboolean (* can_clip_redraws) (ClutterStageWindow *stage_window);
void (* set_scale_factor) (ClutterStageWindow *stage_window,
int factor);
int (* get_scale_factor) (ClutterStageWindow *stage_window);
GList *(* get_views) (ClutterStageWindow *stage_window);
int64_t (* get_frame_counter) (ClutterStageWindow *stage_window);
void (* finish_frame) (ClutterStageWindow *stage_window);
@ -123,7 +128,6 @@ gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWin
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
cairo_rectangle_int_t *clip);
cairo_region_t * _clutter_stage_window_get_redraw_clip (ClutterStageWindow *window);
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
gboolean accept_focus);
@ -136,6 +140,10 @@ void _clutter_stage_window_get_dirty_pixel (ClutterStageWin
gboolean _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window);
void _clutter_stage_window_set_scale_factor (ClutterStageWindow *window,
int factor);
int _clutter_stage_window_get_scale_factor (ClutterStageWindow *window);
GList * _clutter_stage_window_get_views (ClutterStageWindow *window);
void _clutter_stage_window_finish_frame (ClutterStageWindow *window);

View File

@ -364,6 +364,7 @@ clutter_stage_allocate (ClutterActor *self,
float new_width, new_height;
float width, height;
cairo_rectangle_int_t window_size;
int scale_factor;
if (priv->impl == NULL)
return;
@ -464,6 +465,11 @@ clutter_stage_allocate (ClutterActor *self,
*/
_clutter_stage_window_get_geometry (priv->impl, &window_size);
scale_factor = _clutter_stage_window_get_scale_factor (priv->impl);
window_size.width *= scale_factor;
window_size.height *= scale_factor;
cogl_onscreen_clutter_backend_set_size (window_size.width,
window_size.height);
@ -624,13 +630,15 @@ clutter_stage_do_paint_view (ClutterStage *stage,
float clip_poly[8];
float viewport[4];
cairo_rectangle_int_t geom;
int window_scale;
_clutter_stage_window_get_geometry (priv->impl, &geom);
window_scale = _clutter_stage_window_get_scale_factor (priv->impl);
viewport[0] = priv->viewport[0];
viewport[1] = priv->viewport[1];
viewport[2] = priv->viewport[2];
viewport[3] = priv->viewport[3];
viewport[0] = priv->viewport[0] * window_scale;
viewport[1] = priv->viewport[1] * window_scale;
viewport[2] = priv->viewport[2] * window_scale;
viewport[3] = priv->viewport[3] * window_scale;
if (!clip)
{
@ -638,14 +646,16 @@ clutter_stage_do_paint_view (ClutterStage *stage,
clip = &view_layout;
}
clip_poly[0] = MAX (clip->x, 0);
clip_poly[1] = MAX (clip->y, 0);
clip_poly[0] = MAX (clip->x * window_scale, 0);
clip_poly[1] = MAX (clip->y * window_scale, 0);
clip_poly[2] = MIN (clip->x + clip->width, geom.width);
clip_poly[2] = MIN ((clip->x + clip->width) * window_scale,
geom.width * window_scale);
clip_poly[3] = clip_poly[1];
clip_poly[4] = clip_poly[2];
clip_poly[5] = MIN (clip->y + clip->height, geom.height);
clip_poly[5] = MIN ((clip->y + clip->height) * window_scale,
geom.height * window_scale);
clip_poly[6] = clip_poly[0];
clip_poly[7] = clip_poly[5];
@ -1199,44 +1209,45 @@ clutter_stage_real_queue_relayout (ClutterActor *self)
parent_class->queue_relayout (self);
}
static gboolean
clutter_stage_real_queue_redraw (ClutterActor *actor,
ClutterActor *leaf,
ClutterPaintVolume *redraw_clip)
static void
clutter_stage_real_queue_redraw (ClutterActor *actor,
ClutterActor *leaf)
{
ClutterStage *stage = CLUTTER_STAGE (actor);
ClutterStageWindow *stage_window;
ClutterPaintVolume *redraw_clip;
ClutterActorBox bounding_box;
ClutterActorBox intersection_box;
cairo_rectangle_int_t geom, stage_clip;
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
return TRUE;
return;
/* If the backend can't do anything with redraw clips (e.g. it already knows
* it needs to redraw everything anyway) then don't spend time transforming
* any clip volume into stage coordinates... */
stage_window = _clutter_stage_get_window (stage);
if (stage_window == NULL)
return TRUE;
return;
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
{
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
return FALSE;
return;
}
/* Convert the clip volume into stage coordinates and then into an
* axis aligned stage coordinates bounding box...
*/
redraw_clip = _clutter_actor_get_queue_redraw_clip (leaf);
if (redraw_clip == NULL)
{
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
return FALSE;
return;
}
if (redraw_clip->is_empty)
return TRUE;
return;
_clutter_paint_volume_get_stage_paint_box (redraw_clip,
stage,
@ -1252,7 +1263,7 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
/* There is no need to track degenerate/empty redraw clips */
if (intersection_box.x2 <= intersection_box.x1 ||
intersection_box.y2 <= intersection_box.y1)
return TRUE;
return;
/* when converting to integer coordinates make sure we round the edges of the
* clip rectangle outwards... */
@ -1262,7 +1273,6 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
stage_clip.height = intersection_box.y2 - stage_clip.y;
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
return FALSE;
}
gboolean
@ -1315,31 +1325,6 @@ clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
}
}
cairo_region_t *
clutter_stage_get_redraw_clip (ClutterStage *stage)
{
ClutterStagePrivate *priv;
cairo_rectangle_int_t clip;
cairo_region_t *region;
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
priv = stage->priv;
region = _clutter_stage_window_get_redraw_clip (priv->impl);
if (region)
return region;
if (!region)
{
/* Set clip to the full extents of the stage */
_clutter_stage_window_get_geometry (priv->impl, &clip);
region = cairo_region_create_rectangle (&clip);
}
return region;
}
static void
read_pixels_to_file (char *filename_stem,
int x,
@ -1393,19 +1378,19 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
gint dirty_y;
gint read_x;
gint read_y;
int window_scale;
float fb_width, fb_height;
int fb_scale;
int viewport_offset_x;
int viewport_offset_y;
priv = stage->priv;
context = _clutter_context_get_default ();
fb_scale = clutter_stage_view_get_scale (view);
window_scale = _clutter_stage_window_get_scale_factor (priv->impl);
clutter_stage_view_get_layout (view, &view_layout);
fb_width = view_layout.width * fb_scale;
fb_height = view_layout.height * fb_scale;
fb_width = view_layout.width;
fb_height = view_layout.height;
cogl_push_framebuffer (fb);
/* needed for when a context switch happens */
@ -1415,38 +1400,38 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
* picking to not work at all, so setting it the whole framebuffer content
* for now. */
cogl_framebuffer_push_scissor_clip (fb, 0, 0,
view_layout.width * fb_scale,
view_layout.height * fb_scale);
view_layout.width,
view_layout.height);
_clutter_stage_window_get_dirty_pixel (priv->impl, view, &dirty_x, &dirty_y);
if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
{
CLUTTER_NOTE (PICK, "Pushing pick scissor clip x: %d, y: %d, 1x1",
dirty_x * fb_scale,
dirty_y * fb_scale);
cogl_framebuffer_push_scissor_clip (fb, dirty_x * fb_scale, dirty_y * fb_scale, 1, 1);
dirty_x * window_scale,
dirty_y * window_scale);
cogl_framebuffer_push_scissor_clip (fb, dirty_x * window_scale, dirty_y * window_scale, 1, 1);
}
viewport_offset_x = x * fb_scale - dirty_x * fb_scale;
viewport_offset_y = y * fb_scale - dirty_y * fb_scale;
viewport_offset_x = x * window_scale - dirty_x * window_scale;
viewport_offset_y = y * window_scale - dirty_y * window_scale;
CLUTTER_NOTE (PICK, "Setting viewport to %f, %f, %f, %f",
priv->viewport[0] * fb_scale - viewport_offset_x,
priv->viewport[1] * fb_scale - viewport_offset_y,
priv->viewport[2] * fb_scale,
priv->viewport[3] * fb_scale);
cogl_set_viewport (priv->viewport[0] * fb_scale - viewport_offset_x,
priv->viewport[1] * fb_scale - viewport_offset_y,
priv->viewport[2] * fb_scale,
priv->viewport[3] * fb_scale);
priv->viewport[0] * window_scale - viewport_offset_x,
priv->viewport[1] * window_scale - viewport_offset_y,
priv->viewport[2] * window_scale,
priv->viewport[3] * window_scale);
cogl_set_viewport (priv->viewport[0] * window_scale - viewport_offset_x,
priv->viewport[1] * window_scale - viewport_offset_y,
priv->viewport[2] * window_scale,
priv->viewport[3] * window_scale);
read_x = dirty_x * fb_scale;
read_y = dirty_y * fb_scale;
read_x = dirty_x * window_scale;
read_y = dirty_y * window_scale;
CLUTTER_NOTE (PICK, "Performing pick at %i,%i on view %dx%d+%d+%d s: %d",
CLUTTER_NOTE (PICK, "Performing pick at %i,%i on view %dx%d+%d+%d",
x, y,
view_layout.width, view_layout.height,
view_layout.x, view_layout.y, fb_scale);
view_layout.x, view_layout.y);
cogl_color_init_from_4ub (&stage_pick_id, 255, 255, 255, 255);
cogl_clear (&stage_pick_id, COGL_BUFFER_BIT_COLOR | COGL_BUFFER_BIT_DEPTH);
@ -2201,8 +2186,8 @@ clutter_stage_class_init (ClutterStageClass *klass)
g_signal_new (I_("presented"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
_clutter_marshal_VOID__INT_POINTER,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 2,
G_TYPE_INT, G_TYPE_POINTER);
@ -2225,6 +2210,7 @@ clutter_stage_init (ClutterStage *self)
ClutterStagePrivate *priv;
ClutterStageWindow *impl;
ClutterBackend *backend;
int window_scale = 1;
GError *error;
/* a stage is a top-level object */
@ -2242,6 +2228,7 @@ clutter_stage_init (ClutterStage *self)
{
_clutter_stage_set_window (self, impl);
_clutter_stage_window_get_geometry (priv->impl, &geom);
window_scale = _clutter_stage_window_get_scale_factor (priv->impl);
}
else
{
@ -2295,8 +2282,8 @@ clutter_stage_init (ClutterStage *self)
priv->perspective.aspect,
priv->perspective.z_near,
50, /* distance to 2d plane */
geom.width,
geom.height);
geom.width * window_scale,
geom.height * window_scale);
/* FIXME - remove for 2.0 */
@ -3425,6 +3412,16 @@ clutter_stage_ensure_viewport (ClutterStage *stage)
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
}
static void
clutter_stage_apply_scale (ClutterStage *stage)
{
int factor;
factor = _clutter_stage_window_get_scale_factor (stage->priv->impl);
if (factor != 1)
cogl_matrix_scale (&stage->priv->view, factor, factor, 1.f);
}
# define _DEG_TO_RAD(d) ((d) * ((float) G_PI / 180.0f))
/* This calculates a distance into the view frustum to position the
@ -3571,7 +3568,7 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
{
cairo_rectangle_int_t view_layout;
ClutterPerspective perspective;
int fb_scale;
int window_scale;
int viewport_offset_x;
int viewport_offset_y;
float z_2d;
@ -3581,15 +3578,15 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
priv->viewport[2],
priv->viewport[3]);
fb_scale = clutter_stage_view_get_scale (view);
window_scale = _clutter_stage_window_get_scale_factor (priv->impl);
clutter_stage_view_get_layout (view, &view_layout);
viewport_offset_x = view_layout.x * fb_scale;
viewport_offset_y = view_layout.y * fb_scale;
cogl_set_viewport (priv->viewport[0] * fb_scale - viewport_offset_x,
priv->viewport[1] * fb_scale - viewport_offset_y,
priv->viewport[2] * fb_scale,
priv->viewport[3] * fb_scale);
viewport_offset_x = view_layout.x * window_scale;
viewport_offset_y = view_layout.y * window_scale;
cogl_set_viewport (priv->viewport[0] * window_scale - viewport_offset_x,
priv->viewport[1] * window_scale - viewport_offset_y,
priv->viewport[2] * window_scale,
priv->viewport[3] * window_scale);
perspective = priv->perspective;
@ -3620,8 +3617,10 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
perspective.aspect,
perspective.z_near,
z_2d,
priv->viewport[2],
priv->viewport[3]);
priv->viewport[2] * window_scale,
priv->viewport[3] * window_scale);
clutter_stage_apply_scale (stage);
clutter_stage_view_set_dirty_viewport (view, FALSE);
}
@ -4636,6 +4635,23 @@ clutter_stage_skip_sync_delay (ClutterStage *stage)
_clutter_stage_window_schedule_update (stage_window, -1);
}
void
_clutter_stage_set_scale_factor (ClutterStage *stage,
int factor)
{
ClutterStagePrivate *priv = stage->priv;
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return;
if (priv->impl == NULL)
return;
_clutter_stage_window_set_scale_factor (priv->impl, factor);
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
}
int64_t
clutter_stage_get_frame_counter (ClutterStage *stage)
{

View File

@ -245,9 +245,6 @@ guchar * clutter_stage_read_pixels (ClutterStage
CLUTTER_AVAILABLE_IN_ALL
void clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
cairo_rectangle_int_t *clip);
CLUTTER_AVAILABLE_IN_MUTTER
cairo_region_t * clutter_stage_get_redraw_clip (ClutterStage *stage);
CLUTTER_AVAILABLE_IN_ALL
void clutter_stage_ensure_viewport (ClutterStage *stage);
CLUTTER_AVAILABLE_IN_ALL

View File

@ -312,7 +312,7 @@ G_BEGIN_DECLS
*
* Since: 1.2
*/
extern const guint clutter_major_version;
const guint clutter_major_version;
/**
* clutter_minor_version:
@ -326,7 +326,7 @@ extern const guint clutter_major_version;
*
* Since: 1.2
*/
extern const guint clutter_minor_version;
const guint clutter_minor_version;
/**
* clutter_micro_version:
@ -340,7 +340,7 @@ extern const guint clutter_minor_version;
*
* Since: 1.2
*/
extern const guint clutter_micro_version;
const guint clutter_micro_version;
G_END_DECLS

View File

@ -54,7 +54,7 @@ typedef struct _ClutterStageViewCoglPrivate
/* Stores a list of previous damaged areas in the stage coordinate space */
#define DAMAGE_HISTORY_MAX 16
#define DAMAGE_HISTORY(x) ((x) & (DAMAGE_HISTORY_MAX - 1))
cairo_region_t * damage_history[DAMAGE_HISTORY_MAX];
cairo_rectangle_int_t damage_history[DAMAGE_HISTORY_MAX];
unsigned int damage_index;
} ClutterStageViewCoglPrivate;
@ -246,10 +246,13 @@ clutter_stage_cogl_has_redraw_clips (ClutterStageWindow *stage_window)
/* NB: at the start of each new frame there is an implied clip that
* clips everything (i.e. nothing would be drawn) so we need to make
* sure we return True in the un-initialized case here.
*
* NB: a clip width of 0 means a full stage redraw has been queued
* so we effectively don't have any redraw clips in that case.
*/
if (!stage_cogl->initialized_redraw_clip ||
(stage_cogl->initialized_redraw_clip &&
stage_cogl->redraw_clip))
stage_cogl->bounding_redraw_clip.width != 0))
return TRUE;
else
return FALSE;
@ -260,9 +263,9 @@ clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
/* NB: a NULL clip means a full stage redraw is required */
/* NB: a clip width of 0 means a full stage redraw is required */
if (stage_cogl->initialized_redraw_clip &&
!stage_cogl->redraw_clip)
stage_cogl->bounding_redraw_clip.width == 0)
return TRUE;
else
return FALSE;
@ -293,11 +296,11 @@ clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
return;
/* A NULL stage clip means a full stage redraw has been queued and
* we keep track of this by setting a NULL redraw_clip.
*/
* we keep track of this by setting a zero width
* stage_cogl->bounding_redraw_clip */
if (stage_clip == NULL)
{
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
stage_cogl->bounding_redraw_clip.width = 0;
stage_cogl->initialized_redraw_clip = TRUE;
return;
}
@ -306,27 +309,34 @@ clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
if (stage_clip->width == 0 || stage_clip->height == 0)
return;
if (!stage_cogl->redraw_clip)
if (!stage_cogl->initialized_redraw_clip)
{
stage_cogl->redraw_clip = cairo_region_create_rectangle (stage_clip);
stage_cogl->bounding_redraw_clip = *stage_clip;
}
else
else if (stage_cogl->bounding_redraw_clip.width > 0)
{
cairo_region_union_rectangle (stage_cogl->redraw_clip, stage_clip);
_clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
stage_clip,
&stage_cogl->bounding_redraw_clip);
}
stage_cogl->initialized_redraw_clip = TRUE;
}
static cairo_region_t *
clutter_stage_cogl_get_redraw_clip (ClutterStageWindow *stage_window)
static gboolean
clutter_stage_cogl_get_redraw_clip_bounds (ClutterStageWindow *stage_window,
cairo_rectangle_int_t *stage_clip)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
if (stage_cogl->using_clipped_redraw && stage_cogl->redraw_clip)
return cairo_region_copy (stage_cogl->redraw_clip);
if (stage_cogl->using_clipped_redraw)
{
*stage_clip = stage_cogl->bounding_redraw_clip;
return NULL;
return TRUE;
}
return FALSE;
}
static inline gboolean
@ -404,51 +414,37 @@ swap_framebuffer (ClutterStageWindow *stage_window,
static void
paint_stage (ClutterStageCogl *stage_cogl,
ClutterStageView *view,
cairo_region_t *clip)
const cairo_rectangle_int_t *clip)
{
ClutterStage *stage = stage_cogl->wrapper;
cairo_rectangle_int_t clip_rect;
cairo_region_get_extents (clip, &clip_rect);
_clutter_stage_maybe_setup_viewport (stage, view);
_clutter_stage_paint_view (stage, view, &clip_rect);
_clutter_stage_paint_view (stage, view, clip);
if (clutter_stage_view_get_onscreen (view) !=
clutter_stage_view_get_framebuffer (view))
{
clutter_stage_view_blit_offscreen (view, &clip_rect);
clutter_stage_view_blit_offscreen (view, clip);
}
}
static void
fill_current_damage_history (ClutterStageView *view,
cairo_region_t *damage)
fill_current_damage_history_and_step (ClutterStageView *view)
{
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (view);
ClutterStageViewCoglPrivate *view_priv =
clutter_stage_view_cogl_get_instance_private (view_cogl);
cairo_region_t **current_damage;
cairo_rectangle_int_t view_rect;
cairo_rectangle_int_t *current_damage;
current_damage =
&view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index)];
clutter_stage_view_get_layout (view, &view_rect);
g_clear_pointer (current_damage, cairo_region_destroy);
*current_damage = cairo_region_copy (damage);
*current_damage = view_rect;
view_priv->damage_index++;
}
static void
fill_current_damage_history_rectangle (ClutterStageView *view,
const cairo_rectangle_int_t *rect)
{
cairo_region_t *damage;
damage = cairo_region_create_rectangle (rect);
fill_current_damage_history (view, damage);
cairo_region_destroy (damage);
}
static void
transform_swap_region_to_onscreen (ClutterStageView *view,
cairo_rectangle_int_t *swap_region)
@ -503,13 +499,11 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
gboolean do_swap_buffer;
gboolean swap_with_damage;
ClutterActor *wrapper;
cairo_region_t *redraw_clip;
cairo_region_t *clip_region;
cairo_rectangle_int_t redraw_clip;
cairo_rectangle_int_t swap_region;
cairo_rectangle_int_t clip_rect;
cairo_rectangle_int_t redraw_rect;
cairo_rectangle_int_t clip_region;
gboolean clip_region_empty;
int fb_scale;
int window_scale;
wrapper = CLUTTER_ACTOR (stage_cogl->wrapper);
@ -523,19 +517,20 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
cogl_is_onscreen (fb) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
/* NB: a NULL redraw clip == full stage redraw */
if (!stage_cogl->redraw_clip)
/* NB: a zero width redraw clip == full stage redraw */
if (stage_cogl->bounding_redraw_clip.width == 0)
have_clip = FALSE;
else
{
cairo_region_t *view_region;
redraw_clip = cairo_region_copy (stage_cogl->redraw_clip);
redraw_clip = stage_cogl->bounding_redraw_clip;
_clutter_util_rectangle_intersection (&redraw_clip,
&view_rect,
&redraw_clip);
view_region = cairo_region_create_rectangle (&view_rect);
cairo_region_intersect (redraw_clip, view_region);
have_clip = !cairo_region_equal (redraw_clip, view_region);
cairo_region_destroy (view_region);
have_clip = !(redraw_clip.x == view_rect.x &&
redraw_clip.y == view_rect.y &&
redraw_clip.width == view_rect.width &&
redraw_clip.height == view_rect.height);
}
may_use_clipped_redraw = FALSE;
@ -547,12 +542,11 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
{
may_use_clipped_redraw = TRUE;
clip_region = cairo_region_reference (redraw_clip);
clip_region = redraw_clip;
}
else
{
clip_region = cairo_region_create ();
redraw_clip = cairo_region_reference (clip_region);
clip_region = (cairo_rectangle_int_t){ 0 };
}
if (may_use_clipped_redraw &&
@ -561,9 +555,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
else
use_clipped_redraw = FALSE;
clip_region_empty = may_use_clipped_redraw && cairo_region_is_empty (clip_region);
clip_region_empty = may_use_clipped_redraw && clip_region.width == 0;
fb_scale = clutter_stage_view_get_scale (view);
window_scale = _clutter_stage_window_get_scale_factor (stage_window);
swap_with_damage = FALSE;
if (has_buffer_age)
@ -571,26 +565,34 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
if (use_clipped_redraw && !clip_region_empty)
{
int age, i;
cairo_rectangle_int_t *current_damage =
&view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index++)];
age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
if (valid_buffer_age (view_cogl, age))
{
fill_current_damage_history (view, clip_region);
*current_damage = clip_region;
for (i = 1; i <= age; i++)
{
cairo_region_t *damage =
view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - i - 1)];
cairo_region_union (clip_region, damage);
cairo_rectangle_int_t *damage =
&view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - i - 1)];
_clutter_util_rectangle_union (&clip_region, damage, &clip_region);
}
/* Update the redraw clip state with the extra damage. */
cairo_region_union (stage_cogl->redraw_clip, clip_region);
/* Update the bounding redraw clip state with the extra damage. */
_clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
&clip_region,
&stage_cogl->bounding_redraw_clip);
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: num rects: %d\n",
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: x=%d, y=%d, width=%d, height=%d\n",
age,
cairo_region_num_rectangles (clip_region));
clip_region.x,
clip_region.y,
clip_region.width,
clip_region.height);
swap_with_damage = TRUE;
}
@ -598,17 +600,15 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
{
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", age);
use_clipped_redraw = FALSE;
fill_current_damage_history_rectangle (view, &view_rect);
*current_damage = view_rect;
}
}
else if (!use_clipped_redraw)
{
fill_current_damage_history_rectangle (view, &view_rect);
fill_current_damage_history_and_step (view);
}
}
cairo_region_get_extents (clip_region, &clip_rect);
cogl_push_framebuffer (fb);
if (use_clipped_redraw && clip_region_empty)
{
@ -621,21 +621,21 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
CLUTTER_NOTE (CLIPPING,
"Stage clip pushed: x=%d, y=%d, width=%d, height=%d\n",
clip_rect.x,
clip_rect.y,
clip_rect.width,
clip_rect.height);
clip_region.x,
clip_region.y,
clip_region.width,
clip_region.height);
stage_cogl->using_clipped_redraw = TRUE;
scissor_x = (clip_rect.x - view_rect.x) * fb_scale;
scissor_y = (clip_rect.y - view_rect.y) * fb_scale;
scissor_x = (clip_region.x - view_rect.x) * window_scale;
scissor_y = (clip_region.y - view_rect.y) * window_scale;
cogl_framebuffer_push_scissor_clip (fb,
scissor_x,
scissor_y,
clip_rect.width * fb_scale,
clip_rect.height * fb_scale);
paint_stage (stage_cogl, view, clip_region);
clip_region.width * window_scale,
clip_region.height * window_scale);
paint_stage (stage_cogl, view, &clip_region);
cogl_framebuffer_pop_clip (fb);
stage_cogl->using_clipped_redraw = FALSE;
@ -645,7 +645,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
CLUTTER_NOTE (CLIPPING, "Unclipped stage paint\n");
/* If we are trying to debug redraw issues then we want to pass
* the redraw_clip so it can be visualized */
* the bounding_redraw_clip so it can be visualized */
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS) &&
may_use_clipped_redraw &&
!clip_region_empty)
@ -653,39 +653,31 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
int scissor_x;
int scissor_y;
scissor_x = (clip_rect.x - view_rect.x) * fb_scale;;
scissor_y = (clip_rect.y - view_rect.y) * fb_scale;
scissor_x = (clip_region.x - view_rect.x) * window_scale;;
scissor_y = (clip_region.y - view_rect.y) * window_scale;
cogl_framebuffer_push_scissor_clip (fb,
scissor_x,
scissor_y,
clip_rect.width * fb_scale,
clip_rect.height * fb_scale);
paint_stage (stage_cogl, view, clip_region);
clip_region.width * window_scale,
clip_region.height * window_scale);
paint_stage (stage_cogl, view, &clip_region);
cogl_framebuffer_pop_clip (fb);
}
else
{
cairo_region_t *view_region;
view_region = cairo_region_create_rectangle (&view_rect);
paint_stage (stage_cogl, view, view_region);
cairo_region_destroy (view_region);
}
paint_stage (stage_cogl, view, &view_rect);
}
cogl_pop_framebuffer ();
cairo_region_get_extents (redraw_clip, &redraw_rect);
if (may_use_clipped_redraw &&
G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)))
{
CoglContext *ctx = cogl_framebuffer_get_context (fb);
static CoglPipeline *outline = NULL;
ClutterActor *actor = CLUTTER_ACTOR (wrapper);
float x_1 = redraw_rect.x;
float x_2 = redraw_rect.x + redraw_rect.width;
float y_1 = redraw_rect.y;
float y_2 = redraw_rect.y + redraw_rect.height;
float x_1 = redraw_clip.x;
float x_2 = redraw_clip.x + redraw_clip.width;
float y_1 = redraw_clip.y;
float y_2 = redraw_clip.y + redraw_clip.height;
CoglVertexP2 quad[4] = {
{ x_1, y_1 },
{ x_2, y_1 },
@ -732,10 +724,10 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
else if (use_clipped_redraw)
{
swap_region = (cairo_rectangle_int_t) {
.x = (clip_rect.x - view_rect.x) * fb_scale,
.y = (clip_rect.y - view_rect.y) * fb_scale,
.width = clip_rect.width * fb_scale,
.height = clip_rect.height * fb_scale,
.x = (clip_region.x - view_rect.x) * window_scale,
.y = (clip_region.y - view_rect.y) * window_scale,
.width = clip_region.width * window_scale,
.height = clip_region.height * window_scale,
};
g_assert (swap_region.width > 0);
do_swap_buffer = TRUE;
@ -745,8 +737,8 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
swap_region = (cairo_rectangle_int_t) {
.x = 0,
.y = 0,
.width = view_rect.width * fb_scale,
.height = view_rect.height * fb_scale,
.width = view_rect.width * window_scale,
.height = view_rect.height * window_scale,
};
do_swap_buffer = TRUE;
}
@ -757,11 +749,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
do_swap_buffer = TRUE;
}
if (redraw_clip)
cairo_region_destroy (redraw_clip);
if (clip_region)
cairo_region_destroy (clip_region);
if (do_swap_buffer)
{
if (clutter_stage_view_get_onscreen (view) !=
@ -809,7 +796,6 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
/* reset the redraw clipping for the next paint... */
stage_cogl->initialized_redraw_clip = FALSE;
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
stage_cogl->frame_count++;
}
@ -824,7 +810,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
gboolean has_buffer_age =
cogl_is_onscreen (framebuffer) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
cairo_rectangle_int_t rect;
cairo_rectangle_int_t *rect;
if (!has_buffer_age)
{
@ -837,18 +823,12 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
ClutterStageViewCoglPrivate *view_priv =
clutter_stage_view_cogl_get_instance_private (view_cogl);
cairo_rectangle_int_t view_layout;
cairo_region_t *damage;
clutter_stage_view_get_layout (view, &view_layout);
damage = view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - 1)];
if (damage)
cairo_region_get_rectangle (damage, 0, &rect);
else
rect.x = rect.y = 0;
*x = rect.x - view_layout.x;
*y = rect.y - view_layout.y;
rect = &view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - 1)];
*x = rect->x - view_layout.x;
*y = rect->y - view_layout.y;
}
}
@ -867,7 +847,7 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
iface->add_redraw_clip = clutter_stage_cogl_add_redraw_clip;
iface->has_redraw_clips = clutter_stage_cogl_has_redraw_clips;
iface->ignoring_redraw_clips = clutter_stage_cogl_ignoring_redraw_clips;
iface->get_redraw_clip = clutter_stage_cogl_get_redraw_clip;
iface->get_redraw_clip_bounds = clutter_stage_cogl_get_redraw_clip_bounds;
iface->redraw = clutter_stage_cogl_redraw;
iface->get_dirty_pixel = clutter_stage_cogl_get_dirty_pixel;
}

View File

@ -59,7 +59,7 @@ struct _ClutterStageCogl
* junk frames to start with. */
unsigned int frame_count;
cairo_region_t *redraw_clip;
cairo_rectangle_int_t bounding_redraw_clip;
guint initialized_redraw_clip : 1;

View File

@ -102,9 +102,6 @@ struct _ClutterDeviceManagerEvdevPrivate
gpointer constrain_data;
GDestroyNotify constrain_data_notify;
ClutterRelativeMotionFilter relative_motion_filter;
gpointer relative_motion_filter_user_data;
ClutterStageManager *stage_manager;
guint stage_added_handler;
guint stage_removed_handler;
@ -127,7 +124,6 @@ G_DEFINE_TYPE_WITH_CODE (ClutterDeviceManagerEvdev,
static ClutterOpenDeviceCallback device_open_callback;
static ClutterCloseDeviceCallback device_close_callback;
static gpointer device_callback_data;
static gchar * evdev_seat_id;
#ifdef CLUTTER_ENABLE_DEBUG
static const char *device_type_str[] = {
@ -267,22 +263,6 @@ _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *mana
}
}
void
_clutter_device_manager_evdev_filter_relative_motion (ClutterDeviceManagerEvdev *manager_evdev,
ClutterInputDevice *device,
float x,
float y,
float *dx,
float *dy)
{
ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
if (!priv->relative_motion_filter)
return;
priv->relative_motion_filter (device, x, y, dx, dy,
priv->relative_motion_filter_user_data);
}
static ClutterEvent *
new_absolute_motion_event (ClutterInputDevice *input_device,
@ -331,9 +311,6 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x;
event->motion.y = y;
clutter_input_device_evdev_translate_coordinates (input_device, stage,
&event->motion.x,
&event->motion.y);
event->motion.axes = axes;
clutter_event_set_source_device (event, input_device);
@ -377,23 +354,11 @@ notify_relative_tool_motion (ClutterInputDevice *input_device,
gfloat dy,
gdouble *axes)
{
ClutterInputDeviceEvdev *device_evdev;
ClutterEvent *event;
ClutterSeatEvdev *seat;
gfloat x, y;
device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
seat = _clutter_input_device_evdev_get_seat (device_evdev);
x = input_device->current_x + dx;
y = input_device->current_y + dy;
_clutter_device_manager_evdev_filter_relative_motion (seat->manager_evdev,
input_device,
seat->pointer_x,
seat->pointer_y,
&dx,
&dy);
event = new_absolute_motion_event (input_device, time_us, x, y, axes);
_clutter_evdev_event_set_relative_motion (event, dx, dy, 0, 0);
@ -544,10 +509,6 @@ notify_touch_event (ClutterInputDevice *input_device,
event->touch.device = seat->core_pointer;
event->touch.x = x;
event->touch.y = y;
clutter_input_device_evdev_translate_coordinates (input_device, stage,
&event->touch.x,
&event->touch.y);
/* "NULL" sequences are special cased in clutter */
event->touch.sequence = GINT_TO_POINTER (slot + 1);
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
@ -569,8 +530,7 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
gdouble dx,
gdouble dy,
gdouble angle_delta,
gdouble scale,
guint n_fingers)
gdouble scale)
{
ClutterInputDeviceEvdev *device_evdev;
ClutterSeatEvdev *seat;
@ -601,7 +561,6 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
event->touchpad_pinch.dy = dy;
event->touchpad_pinch.angle_delta = angle_delta;
event->touchpad_pinch.scale = scale;
event->touchpad_pinch.n_fingers = n_fingers;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
@ -699,7 +658,6 @@ notify_pad_button (ClutterInputDevice *input_device,
guint64 time_us,
guint32 button,
guint32 mode_group,
guint32 mode,
guint32 pressed)
{
ClutterInputDeviceEvdev *device_evdev;
@ -725,7 +683,6 @@ notify_pad_button (ClutterInputDevice *input_device,
event->pad_button.stage = stage;
event->pad_button.button = button;
event->pad_button.group = mode_group;
event->pad_button.mode = mode;
clutter_event_set_device (event, input_device);
clutter_event_set_source_device (event, input_device);
clutter_event_set_time (event, us2ms (time_us));
@ -741,7 +698,6 @@ notify_pad_strip (ClutterInputDevice *input_device,
guint32 strip_number,
guint32 strip_source,
guint32 mode_group,
guint32 mode,
gdouble value)
{
ClutterInputDeviceEvdev *device_evdev;
@ -771,7 +727,6 @@ notify_pad_strip (ClutterInputDevice *input_device,
event->pad_strip.strip_number = strip_number;
event->pad_strip.value = value;
event->pad_strip.group = mode_group;
event->pad_strip.mode = mode;
clutter_event_set_device (event, input_device);
clutter_event_set_source_device (event, input_device);
clutter_event_set_time (event, us2ms (time_us));
@ -787,7 +742,6 @@ notify_pad_ring (ClutterInputDevice *input_device,
guint32 ring_number,
guint32 ring_source,
guint32 mode_group,
guint32 mode,
gdouble angle)
{
ClutterInputDeviceEvdev *device_evdev;
@ -817,7 +771,6 @@ notify_pad_ring (ClutterInputDevice *input_device,
event->pad_ring.ring_number = ring_number;
event->pad_ring.angle = angle;
event->pad_ring.group = mode_group;
event->pad_ring.mode = mode;
clutter_event_set_device (event, input_device);
clutter_event_set_source_device (event, input_device);
clutter_event_set_time (event, us2ms (time_us));
@ -1255,17 +1208,11 @@ input_device_update_tool (ClutterInputDevice *input_device,
}
}
if (evdev_device->last_tool != tool)
{
evdev_device->last_tool = tool;
g_signal_emit_by_name (clutter_device_manager_get_default (),
"tool-changed", input_device, tool);
}
evdev_device->last_tool = tool;
}
static gdouble *
translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event,
ClutterInputDeviceTool *tool)
translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event)
{
GArray *axes = g_array_new (FALSE, FALSE, sizeof (gdouble));
struct libinput_tablet_tool *libinput_tool;
@ -1287,7 +1234,6 @@ translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event,
if (libinput_tablet_tool_has_pressure (libinput_tool))
{
value = libinput_event_tablet_tool_get_pressure (tablet_event);
value = clutter_input_device_tool_evdev_translate_pressure (tool, value);
g_array_append_val (axes, value);
}
@ -1671,7 +1617,6 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
struct libinput_event_gesture *gesture_event =
libinput_event_get_gesture_event (event);
ClutterTouchpadGesturePhase phase;
guint n_fingers;
guint64 time_us;
if (libinput_event_get_type (event) == LIBINPUT_EVENT_GESTURE_PINCH_BEGIN)
@ -1680,10 +1625,9 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
phase = libinput_event_gesture_get_cancelled (gesture_event) ?
CLUTTER_TOUCHPAD_GESTURE_PHASE_CANCEL : CLUTTER_TOUCHPAD_GESTURE_PHASE_END;
n_fingers = libinput_event_gesture_get_finger_count (gesture_event);
device = libinput_device_get_user_data (libinput_device);
time_us = libinput_event_gesture_get_time_usec (gesture_event);
notify_pinch_gesture_event (device, phase, time_us, 0, 0, 0, 0, n_fingers);
notify_pinch_gesture_event (device, phase, time_us, 0, 0, 0, 0);
break;
}
case LIBINPUT_EVENT_GESTURE_PINCH_UPDATE:
@ -1691,10 +1635,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
struct libinput_event_gesture *gesture_event =
libinput_event_get_gesture_event (event);
gdouble angle_delta, scale, dx, dy;
guint n_fingers;
guint64 time_us;
n_fingers = libinput_event_gesture_get_finger_count (gesture_event);
device = libinput_device_get_user_data (libinput_device);
time_us = libinput_event_gesture_get_time_usec (gesture_event);
angle_delta = libinput_event_gesture_get_angle_delta (gesture_event);
@ -1704,7 +1646,7 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
notify_pinch_gesture_event (device,
CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE,
time_us, dx, dy, angle_delta, scale, n_fingers);
time_us, dx, dy, angle_delta, scale);
break;
}
case LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN:
@ -1765,8 +1707,7 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
if (!stage)
break;
axes = translate_tablet_axes (tablet_event,
evdev_device->last_tool);
axes = translate_tablet_axes (tablet_event);
if (!axes)
break;
@ -1806,11 +1747,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
libinput_tool = libinput_event_tablet_tool_get_tool (tablet_event);
if (state == LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN)
input_device_update_tool (device, libinput_tool);
input_device_update_tool (device, libinput_tool);
notify_proximity (device, time, state == LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN);
if (state == LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT)
input_device_update_tool (device, NULL);
break;
}
case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
@ -1852,7 +1790,7 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
{
guint64 time;
guint32 button_state, button, group, mode;
guint32 button_state, button, group;
struct libinput_tablet_pad_mode_group *mode_group;
struct libinput_event_tablet_pad *pad_event =
libinput_event_get_tablet_pad_event (event);
@ -1862,18 +1800,17 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
mode_group = libinput_event_tablet_pad_get_mode_group (pad_event);
group = libinput_tablet_pad_mode_group_get_index (mode_group);
mode = libinput_event_tablet_pad_get_mode (pad_event);
button = libinput_event_tablet_pad_get_button_number (pad_event);
button_state = libinput_event_tablet_pad_get_button_state (pad_event) ==
LIBINPUT_BUTTON_STATE_PRESSED;
notify_pad_button (device, time, button, group, mode, button_state);
notify_pad_button (device, time, button, group, button_state);
break;
}
case LIBINPUT_EVENT_TABLET_PAD_STRIP:
{
guint64 time;
guint32 number, source, group, mode;
guint32 number, source, group;
struct libinput_tablet_pad_mode_group *mode_group;
struct libinput_event_tablet_pad *pad_event =
libinput_event_get_tablet_pad_event (event);
@ -1887,15 +1824,14 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
mode_group = libinput_event_tablet_pad_get_mode_group (pad_event);
group = libinput_tablet_pad_mode_group_get_index (mode_group);
mode = libinput_event_tablet_pad_get_mode (pad_event);
notify_pad_strip (device, time, number, source, group, mode, value);
notify_pad_strip (device, time, number, source, group, value);
break;
}
case LIBINPUT_EVENT_TABLET_PAD_RING:
{
guint64 time;
guint32 number, source, group, mode;
guint32 number, source, group;
struct libinput_tablet_pad_mode_group *mode_group;
struct libinput_event_tablet_pad *pad_event =
libinput_event_get_tablet_pad_event (event);
@ -1909,9 +1845,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
mode_group = libinput_event_tablet_pad_get_mode_group (pad_event);
group = libinput_tablet_pad_mode_group_get_index (mode_group);
mode = libinput_event_tablet_pad_get_mode (pad_event);
notify_pad_ring (device, time, number, source, group, mode, angle);
notify_pad_ring (device, time, number, source, group, angle);
break;
}
default:
@ -2093,8 +2028,7 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
return;
}
if (libinput_udev_assign_seat (priv->libinput,
evdev_seat_id ? evdev_seat_id : "seat0") == -1)
if (libinput_udev_assign_seat (priv->libinput, "seat0") == -1)
{
g_critical ("Failed to assign a seat to the libinput object.");
libinput_unref (priv->libinput);
@ -2692,23 +2626,6 @@ clutter_evdev_set_pointer_constrain_callback (ClutterDeviceManager *e
priv->constrain_data_notify = user_data_notify;
}
void
clutter_evdev_set_relative_motion_filter (ClutterDeviceManager *evdev,
ClutterRelativeMotionFilter filter,
gpointer user_data)
{
ClutterDeviceManagerEvdev *manager_evdev;
ClutterDeviceManagerEvdevPrivate *priv;
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
priv = manager_evdev->priv;
priv->relative_motion_filter = filter;
priv->relative_motion_filter_user_data = user_data;
}
/**
* clutter_evdev_set_keyboard_repeat:
* @evdev: the #ClutterDeviceManager created by the evdev backend
@ -2860,18 +2777,3 @@ clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
{
notify_absolute_motion (pointer_device, ms2us(time_), x, y, NULL);
}
/**
* clutter_evdev_set_seat_id:
* @seat_id: The seat ID
*
* Sets the seat to assign to the libinput context.
*
* For reliable effects, this function must be called before clutter_init().
*/
void
clutter_evdev_set_seat_id (const gchar *seat_id)
{
g_free (evdev_seat_id);
evdev_seat_id = g_strdup (seat_id);
}

View File

@ -76,13 +76,6 @@ void _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev
float *new_x,
float *new_y);
void _clutter_device_manager_evdev_filter_relative_motion (ClutterDeviceManagerEvdev *manager_evdev,
ClutterInputDevice *device,
float x,
float y,
float *dx,
float *dy);
void _clutter_device_manager_evdev_dispatch (ClutterDeviceManagerEvdev *manager_evdev);
static inline guint64

View File

@ -57,9 +57,6 @@ void clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callba
ClutterCloseDeviceCallback close_callback,
gpointer user_data);
CLUTTER_AVAILABLE_IN_ALL
void clutter_evdev_set_seat_id (const gchar *seat_id);
CLUTTER_AVAILABLE_IN_1_10
void clutter_evdev_release_devices (void);
CLUTTER_AVAILABLE_IN_1_10
@ -97,18 +94,6 @@ void clutter_evdev_set_pointer_constrain_callback (ClutterDeviceManager
gpointer user_data,
GDestroyNotify user_data_notify);
typedef void (*ClutterRelativeMotionFilter) (ClutterInputDevice *device,
float x,
float y,
float *dx,
float *dy,
gpointer user_data);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_evdev_set_relative_motion_filter (ClutterDeviceManager *evdev,
ClutterRelativeMotionFilter filter,
gpointer user_data);
CLUTTER_AVAILABLE_IN_1_16
void clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
struct xkb_keymap *keymap);
@ -165,14 +150,6 @@ gboolean clutter_evdev_event_get_relative_motion (const ClutterEvent *event,
double *dx_unaccel,
double *dy_unaccel);
CLUTTER_AVAILABLE_IN_ALL
void clutter_evdev_input_device_tool_set_pressure_curve (ClutterInputDeviceTool *tool,
gdouble curve[4]);
CLUTTER_AVAILABLE_IN_ALL
void clutter_evdev_input_device_tool_set_button_code (ClutterInputDeviceTool *tool,
guint button,
guint evcode);
G_END_DECLS
#endif /* __CLUTTER_EVDEV_H__ */

View File

@ -35,8 +35,6 @@
#include "clutter-input-device-evdev.h"
#include "clutter-device-manager-evdev.h"
#include "cairo-gobject.h"
typedef struct _ClutterInputDeviceClass ClutterInputDeviceEvdevClass;
#define clutter_input_device_evdev_get_type _clutter_input_device_evdev_get_type
@ -45,15 +43,6 @@ G_DEFINE_TYPE (ClutterInputDeviceEvdev,
clutter_input_device_evdev,
CLUTTER_TYPE_INPUT_DEVICE)
enum {
PROP_0,
PROP_DEVICE_MATRIX,
PROP_OUTPUT_ASPECT_RATIO,
N_PROPS
};
static GParamSpec *obj_props[N_PROPS] = { 0 };
static void
clutter_input_device_evdev_finalize (GObject *object)
{
@ -70,53 +59,6 @@ clutter_input_device_evdev_finalize (GObject *object)
G_OBJECT_CLASS (clutter_input_device_evdev_parent_class)->finalize (object);
}
static void
clutter_input_device_evdev_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterInputDeviceEvdev *device = CLUTTER_INPUT_DEVICE_EVDEV (object);
switch (prop_id)
{
case PROP_DEVICE_MATRIX:
{
const cairo_matrix_t *matrix = g_value_get_boxed (value);
cairo_matrix_init_identity (&device->device_matrix);
cairo_matrix_multiply (&device->device_matrix,
&device->device_matrix, matrix);
break;
}
case PROP_OUTPUT_ASPECT_RATIO:
device->output_ratio = g_value_get_double (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
clutter_input_device_evdev_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ClutterInputDeviceEvdev *device = CLUTTER_INPUT_DEVICE_EVDEV (object);
switch (prop_id)
{
case PROP_DEVICE_MATRIX:
g_value_set_boxed (value, &device->device_matrix);
break;
case PROP_OUTPUT_ASPECT_RATIO:
g_value_set_double (value, device->output_ratio);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static gboolean
clutter_input_device_evdev_keycode_to_evdev (ClutterInputDevice *device,
guint hardware_keycode,
@ -166,83 +108,19 @@ clutter_input_device_evdev_update_from_tool (ClutterInputDevice *device,
g_object_thaw_notify (G_OBJECT (device));
}
static gboolean
clutter_input_device_evdev_is_mode_switch_button (ClutterInputDevice *device,
guint group,
guint button)
{
struct libinput_device *libinput_device;
struct libinput_tablet_pad_mode_group *mode_group;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device, group);
return libinput_tablet_pad_mode_group_button_is_toggle (mode_group, button) != 0;
}
static gint
clutter_input_device_evdev_get_group_n_modes (ClutterInputDevice *device,
gint group)
{
struct libinput_device *libinput_device;
struct libinput_tablet_pad_mode_group *mode_group;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device, group);
return libinput_tablet_pad_mode_group_get_num_modes (mode_group);
}
static gboolean
clutter_input_device_evdev_is_grouped (ClutterInputDevice *device,
ClutterInputDevice *other_device)
{
struct libinput_device *libinput_device, *other_libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
other_libinput_device = clutter_evdev_input_device_get_libinput_device (other_device);
return libinput_device_get_device_group (libinput_device) ==
libinput_device_get_device_group (other_libinput_device);
}
static void
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = clutter_input_device_evdev_finalize;
object_class->set_property = clutter_input_device_evdev_set_property;
object_class->get_property = clutter_input_device_evdev_get_property;
klass->keycode_to_evdev = clutter_input_device_evdev_keycode_to_evdev;
klass->update_from_tool = clutter_input_device_evdev_update_from_tool;
klass->is_mode_switch_button = clutter_input_device_evdev_is_mode_switch_button;
klass->get_group_n_modes = clutter_input_device_evdev_get_group_n_modes;
klass->is_grouped = clutter_input_device_evdev_is_grouped;
obj_props[PROP_DEVICE_MATRIX] =
g_param_spec_boxed ("device-matrix",
P_("Device input matrix"),
P_("Device input matrix"),
CAIRO_GOBJECT_TYPE_MATRIX,
CLUTTER_PARAM_READWRITE);
obj_props[PROP_OUTPUT_ASPECT_RATIO] =
g_param_spec_double ("output-aspect-ratio",
P_("Output aspect ratio"),
P_("Output aspect ratio"),
0, G_MAXDOUBLE, 0,
CLUTTER_PARAM_READWRITE);
g_object_class_install_properties (object_class, N_PROPS, obj_props);
}
static void
clutter_input_device_evdev_init (ClutterInputDeviceEvdev *self)
{
cairo_matrix_init_identity (&self->device_matrix);
self->device_aspect_ratio = 0;
self->output_ratio = 0;
}
/*
@ -265,7 +143,6 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
gchar *vendor, *product;
gint device_id, n_rings = 0, n_strips = 0, n_groups = 1;
gchar *node_path;
gdouble width, height;
type = _clutter_input_device_evdev_determine_type (libinput_device);
vendor = g_strdup_printf ("%.4x", libinput_device_get_id_vendor (libinput_device));
@ -305,9 +182,6 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
g_free (vendor);
g_free (product);
if (libinput_device_get_size (libinput_device, &width, &height) == 0)
device->device_aspect_ratio = width / height;
return CLUTTER_INPUT_DEVICE (device);
}
@ -439,39 +313,3 @@ clutter_evdev_event_sequence_get_slot (const ClutterEventSequence *sequence)
return GPOINTER_TO_INT (sequence) - 1;
}
void
clutter_input_device_evdev_translate_coordinates (ClutterInputDevice *device,
ClutterStage *stage,
gfloat *x,
gfloat *y)
{
ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
double min_x = 0, min_y = 0, max_x = 1, max_y = 1;
gdouble stage_width, stage_height;
double x_d, y_d;
stage_width = clutter_actor_get_width (CLUTTER_ACTOR (stage));
stage_height = clutter_actor_get_height (CLUTTER_ACTOR (stage));
x_d = *x / stage_width;
y_d = *y / stage_height;
/* Apply aspect ratio */
if (device_evdev->output_ratio > 0 &&
device_evdev->device_aspect_ratio > 0)
{
gdouble ratio = device_evdev->device_aspect_ratio / device_evdev->output_ratio;
if (ratio > 1)
x_d *= ratio;
else if (ratio < 1)
y_d *= 1 / ratio;
}
cairo_matrix_transform_point (&device_evdev->device_matrix, &min_x, &min_y);
cairo_matrix_transform_point (&device_evdev->device_matrix, &max_x, &max_y);
cairo_matrix_transform_point (&device_evdev->device_matrix, &x_d, &y_d);
*x = CLAMP (x_d, MIN (min_x, max_x), MAX (min_x, max_x)) * stage_width;
*y = CLAMP (y_d, MIN (min_y, max_y), MAX (min_y, max_y)) * stage_height;
}

View File

@ -66,10 +66,6 @@ struct _ClutterInputDeviceEvdev
struct libinput_device *libinput_device;
ClutterSeatEvdev *seat;
ClutterInputDeviceTool *last_tool;
cairo_matrix_t device_matrix;
gdouble device_aspect_ratio; /* w:h */
gdouble output_ratio; /* w:h */
};
GType _clutter_input_device_evdev_get_type (void) G_GNUC_CONST;
@ -106,11 +102,6 @@ void _clutter_evdev_event_set_relative_motion (ClutterEvent *event,
double dx_unaccel,
double dy_unaccel);
void clutter_input_device_evdev_translate_coordinates (ClutterInputDevice *device,
ClutterStage *stage,
gfloat *x,
gfloat *y);
G_END_DECLS
#endif /* __CLUTTER_INPUT_DEVICE_EVDEV_H__ */

View File

@ -26,7 +26,6 @@
#endif
#include "clutter-input-device-tool-evdev.h"
#include "clutter-evdev.h"
G_DEFINE_TYPE (ClutterInputDeviceToolEvdev, clutter_input_device_tool_evdev,
CLUTTER_TYPE_INPUT_DEVICE_TOOL)
@ -36,7 +35,6 @@ clutter_input_device_tool_evdev_finalize (GObject *object)
{
ClutterInputDeviceToolEvdev *tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (object);
g_hash_table_unref (tool->button_map);
libinput_tablet_tool_unref (tool->tool);
G_OBJECT_CLASS (clutter_input_device_tool_evdev_parent_class)->finalize (object);
@ -53,7 +51,6 @@ clutter_input_device_tool_evdev_class_init (ClutterInputDeviceToolEvdevClass *kl
static void
clutter_input_device_tool_evdev_init (ClutterInputDeviceToolEvdev *tool)
{
tool->button_map = g_hash_table_new (NULL, NULL);
}
ClutterInputDeviceTool *
@ -73,96 +70,3 @@ clutter_input_device_tool_evdev_new (struct libinput_tablet_tool *tool,
return CLUTTER_INPUT_DEVICE_TOOL (evdev_tool);
}
void
clutter_evdev_input_device_tool_set_pressure_curve (ClutterInputDeviceTool *tool,
gdouble curve[4])
{
ClutterInputDeviceToolEvdev *evdev_tool;
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL_EVDEV (tool));
g_return_if_fail (curve[0] >= 0 && curve[0] <= 1 &&
curve[1] >= 0 && curve[1] <= 1 &&
curve[2] >= 0 && curve[2] <= 1 &&
curve[3] >= 0 && curve[3] <= 1);
evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
evdev_tool->pressure_curve[0] = curve[0];
evdev_tool->pressure_curve[1] = curve[1];
evdev_tool->pressure_curve[2] = curve[2];
evdev_tool->pressure_curve[3] = curve[3];
}
void
clutter_evdev_input_device_tool_set_button_code (ClutterInputDeviceTool *tool,
guint button,
guint evcode)
{
ClutterInputDeviceToolEvdev *evdev_tool;
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL_EVDEV (tool));
evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
if (evcode == 0)
{
g_hash_table_remove (evdev_tool->button_map, GUINT_TO_POINTER (button));
}
else
{
g_hash_table_insert (evdev_tool->button_map, GUINT_TO_POINTER (button),
GUINT_TO_POINTER (evcode));
}
}
static gdouble
calculate_bezier_position (gdouble pos,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2)
{
gdouble int1_y, int2_y;
pos = CLAMP (pos, 0, 1);
/* Intersection between 0,0 and x1,y1 */
int1_y = pos * y1;
/* Intersection between x2,y2 and 1,1 */
int2_y = (pos * (1 - y2)) + y2;
/* Find the new position in the line traced by the previous points */
return (pos * (int2_y - int1_y)) + int1_y;
}
gdouble
clutter_input_device_tool_evdev_translate_pressure (ClutterInputDeviceTool *tool,
gdouble pressure)
{
ClutterInputDeviceToolEvdev *evdev_tool;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool), pressure);
evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
return calculate_bezier_position (CLAMP (pressure, 0, 1),
evdev_tool->pressure_curve[0],
evdev_tool->pressure_curve[1],
evdev_tool->pressure_curve[2],
evdev_tool->pressure_curve[3]);
}
guint
clutter_input_device_tool_evdev_get_button_code (ClutterInputDeviceTool *tool,
guint button)
{
ClutterInputDeviceToolEvdev *evdev_tool;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool), 0);
evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
return GPOINTER_TO_UINT (g_hash_table_lookup (evdev_tool->button_map,
GUINT_TO_POINTER (button)));
}

View File

@ -59,8 +59,6 @@ struct _ClutterInputDeviceToolEvdev
{
ClutterInputDeviceTool parent_instance;
struct libinput_tablet_tool *tool;
GHashTable *button_map;
gdouble pressure_curve[4];
};
struct _ClutterInputDeviceToolEvdevClass
@ -74,11 +72,6 @@ ClutterInputDeviceTool * clutter_input_device_tool_evdev_new (struct libinp
guint64 serial,
ClutterInputDeviceToolType type);
gdouble clutter_input_device_tool_evdev_translate_pressure (ClutterInputDeviceTool *tool,
gdouble pressure);
guint clutter_input_device_tool_evdev_get_button_code (ClutterInputDeviceTool *tool,
guint button);
G_END_DECLS
#endif /* __CLUTTER_INPUT_DEVICE_EVDEV_TOOL_H__ */

View File

@ -32,7 +32,6 @@
#include "clutter-event-private.h"
#include "clutter-input-device-evdev.h"
#include "clutter-input-device-tool-evdev.h"
#include "clutter-main.h"
/* Try to keep the pointer inside the stage. Hopefully no one is using
@ -405,13 +404,6 @@ clutter_seat_evdev_notify_relative_motion (ClutterSeatEvdev *seat,
if (!_clutter_input_device_get_stage (input_device))
return;
_clutter_device_manager_evdev_filter_relative_motion (seat->manager_evdev,
input_device,
seat->pointer_x,
seat->pointer_y,
&dx,
&dy);
new_x = seat->pointer_x + dx;
new_y = seat->pointer_y + dy;
event = new_absolute_motion_event (seat, input_device,
@ -445,7 +437,6 @@ clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
uint32_t button,
uint32_t state)
{
ClutterInputDeviceEvdev *device_evdev = (ClutterInputDeviceEvdev *) input_device;
ClutterStage *stage;
ClutterEvent *event = NULL;
gint button_nr;
@ -541,21 +532,13 @@ clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);
if (device_evdev->last_tool)
{
/* Apply the button event code as per the tool mapping */
guint mapped_button;
mapped_button = clutter_input_device_tool_evdev_get_button_code (device_evdev->last_tool,
button_nr);
if (mapped_button != 0)
button = mapped_button;
}
_clutter_evdev_event_set_event_code (event, button);
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
ClutterInputDeviceEvdev *device_evdev =
CLUTTER_INPUT_DEVICE_EVDEV (input_device);
clutter_event_set_device_tool (event, device_evdev->last_tool);
clutter_event_set_device (event, input_device);
}

View File

@ -3,8 +3,8 @@ exec_prefix=@exec_prefix@
libdir=@libdir@/mutter
includedir=@includedir@/mutter
apiversion=@LIBMUTTER_API_VERSION@
requires=@CLUTTER_REQUIRES@ mutter-cogl-@LIBMUTTER_API_VERSION@
apiversion=@CLUTTER_API_VERSION@
requires=@CLUTTER_REQUIRES@ mutter-cogl-1.0
requires_private=@CLUTTER_REQUIRES_PRIVATE@
backends=@CLUTTER_BACKENDS@
@ -17,7 +17,7 @@ cogl_driver=deprecated
Name: Mutter Clutter
Description: Mutter's Clutter Private Library
Version: @MUTTER_VERSION@
Version: @VERSION@
Libs: -L${libdir} -lmutter-clutter-${apiversion}
Cflags: -I${includedir}/clutter-${apiversion}
Requires: ${requires}

View File

@ -136,6 +136,7 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
ClutterTranslateReturn res;
ClutterStage *stage;
XEvent *xevent;
int window_scale;
manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (translator);
backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
@ -151,6 +152,8 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
stage_x11 = CLUTTER_STAGE_X11 (_clutter_stage_get_window (stage));
window_scale = stage_x11->scale_factor;
event->any.stage = stage;
res = CLUTTER_TRANSLATE_CONTINUE;
@ -223,8 +226,8 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
event->scroll.direction = CLUTTER_SCROLL_RIGHT;
event->scroll.time = xevent->xbutton.time;
event->scroll.x = xevent->xbutton.x;
event->scroll.y = xevent->xbutton.y;
event->scroll.x = xevent->xbutton.x / window_scale;
event->scroll.y = xevent->xbutton.y / window_scale;
event->scroll.modifier_state = xevent->xbutton.state;
event->scroll.axes = NULL;
break;
@ -232,8 +235,8 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
default:
event->button.type = event->type = CLUTTER_BUTTON_PRESS;
event->button.time = xevent->xbutton.time;
event->button.x = xevent->xbutton.x;
event->button.y = xevent->xbutton.y;
event->button.x = xevent->xbutton.x / window_scale;
event->button.y = xevent->xbutton.y / window_scale;
event->button.modifier_state = xevent->xbutton.state;
event->button.button = xevent->xbutton.button;
event->button.axes = NULL;
@ -266,8 +269,8 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
event->button.type = event->type = CLUTTER_BUTTON_RELEASE;
event->button.time = xevent->xbutton.time;
event->button.x = xevent->xbutton.x;
event->button.y = xevent->xbutton.y;
event->button.x = xevent->xbutton.x / window_scale;
event->button.y = xevent->xbutton.y / window_scale;
event->button.modifier_state = xevent->xbutton.state;
event->button.button = xevent->xbutton.button;
event->button.axes = NULL;
@ -284,8 +287,8 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
event->motion.type = event->type = CLUTTER_MOTION;
event->motion.time = xevent->xmotion.time;
event->motion.x = xevent->xmotion.x;
event->motion.y = xevent->xmotion.y;
event->motion.x = xevent->xmotion.x / window_scale;
event->motion.y = xevent->xmotion.y / window_scale;
event->motion.modifier_state = xevent->xmotion.state;
event->motion.axes = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
@ -298,8 +301,8 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
event->crossing.type = CLUTTER_ENTER;
event->crossing.time = xevent->xcrossing.time;
event->crossing.x = xevent->xcrossing.x;
event->crossing.y = xevent->xcrossing.y;
event->crossing.x = xevent->xcrossing.x / window_scale;
event->crossing.y = xevent->xcrossing.y / window_scale;
event->crossing.source = CLUTTER_ACTOR (stage);
event->crossing.related = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
@ -324,8 +327,8 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
event->crossing.type = CLUTTER_LEAVE;
event->crossing.time = xevent->xcrossing.time;
event->crossing.x = xevent->xcrossing.x;
event->crossing.y = xevent->xcrossing.y;
event->crossing.x = xevent->xcrossing.x / window_scale;
event->crossing.y = xevent->xcrossing.y / window_scale;
event->crossing.source = CLUTTER_ACTOR (stage);
event->crossing.related = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);

View File

@ -29,8 +29,6 @@
#include "clutter-backend-x11.h"
#include "clutter-input-device-xi2.h"
#include "clutter-input-device-tool-xi2.h"
#include "clutter-virtual-input-device-x11.h"
#include "clutter-stage-x11.h"
#include "clutter-backend.h"
@ -396,8 +394,6 @@ create_device (ClutterDeviceManagerXI2 *manager_xi2,
source = CLUTTER_ERASER_DEVICE;
else if (strstr (name, "cursor") != NULL)
source = CLUTTER_CURSOR_DEVICE;
else if (strstr (name, " pad") != NULL)
source = CLUTTER_PAD_DEVICE;
else if (strstr (name, "wacom") != NULL || strstr (name, "pen") != NULL)
source = CLUTTER_PEN_DEVICE;
else if (strstr (name, "touchpad") != NULL)
@ -464,46 +460,6 @@ create_device (ClutterDeviceManagerXI2 *manager_xi2,
return retval;
}
static void
pad_passive_button_grab (ClutterInputDevice *device)
{
XIGrabModifiers xi_grab_mods = { XIAnyModifier, };
XIEventMask xi_event_mask;
gint device_id, rc;
device_id = clutter_input_device_get_device_id (device);
xi_event_mask.deviceid = device_id;
xi_event_mask.mask_len = XIMaskLen (XI_LASTEVENT);
xi_event_mask.mask = g_new0 (unsigned char, xi_event_mask.mask_len);
XISetMask (xi_event_mask.mask, XI_Motion);
XISetMask (xi_event_mask.mask, XI_ButtonPress);
XISetMask (xi_event_mask.mask, XI_ButtonRelease);
clutter_x11_trap_x_errors ();
rc = XIGrabButton (clutter_x11_get_default_display (),
device_id, XIAnyButton,
clutter_x11_get_root_window (), None,
XIGrabModeSync, XIGrabModeSync,
True, &xi_event_mask, 1, &xi_grab_mods);
if (rc != 0)
{
g_warning ("Could not passively grab pad device: %s",
clutter_input_device_get_device_name (device));
}
else
{
XIAllowEvents (clutter_x11_get_default_display (),
device_id, XIAsyncDevice,
CLUTTER_CURRENT_TIME);
}
clutter_x11_untrap_x_errors ();
g_free (xi_event_mask.mask);
}
static ClutterInputDevice *
add_device (ClutterDeviceManagerXI2 *manager_xi2,
ClutterBackendX11 *backend_x11,
@ -538,9 +494,6 @@ add_device (ClutterDeviceManagerXI2 *manager_xi2,
g_warning ("Unhandled device: %s",
clutter_input_device_get_device_name (device));
if (clutter_input_device_get_device_type (device) == CLUTTER_PAD_DEVICE)
pad_passive_button_grab (device);
/* relationships between devices and signal emissions are not
* necessary while we're constructing the device manager instance
*/
@ -861,8 +814,8 @@ translate_coords (ClutterStageX11 *stage_x11,
clutter_actor_get_size (stage, &stage_width, &stage_height);
*x_out = CLAMP (event_x, 0, stage_width);
*y_out = CLAMP (event_y, 0, stage_height);
*x_out = CLAMP (event_x / stage_x11->scale_factor, 0, stage_width);
*y_out = CLAMP (event_y / stage_x11->scale_factor, 0, stage_height);
}
static gdouble
@ -953,78 +906,6 @@ clutter_device_manager_xi2_select_stage_events (ClutterDeviceManager *manager,
g_free (mask);
}
static guint
device_get_tool_serial (ClutterBackendX11 *backend_x11,
ClutterInputDevice *device)
{
gulong nitems, bytes_after;
guint32 *data = NULL;
guint serial_id = 0;
int rc, format;
Atom type;
Atom prop;
prop = XInternAtom (backend_x11->xdpy, "Wacom Serial IDs", True);
if (prop == None)
return 0;
clutter_x11_trap_x_errors ();
rc = XIGetProperty (backend_x11->xdpy,
clutter_input_device_get_device_id (device),
prop, 0, 4, FALSE, XA_INTEGER, &type, &format, &nitems, &bytes_after,
(guchar **) &data);
clutter_x11_untrap_x_errors ();
if (rc == Success && type == XA_INTEGER && format == 32 && nitems >= 4)
serial_id = data[3];
XFree (data);
return serial_id;
}
static void
handle_property_event (ClutterDeviceManagerXI2 *manager_xi2,
XIEvent *event)
{
XIPropertyEvent *xev = (XIPropertyEvent *) event;
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
Atom serial_ids_prop = XInternAtom (backend_x11->xdpy, "Wacom Serial IDs", True);
ClutterInputDevice *device;
device = g_hash_table_lookup (manager_xi2->devices_by_id,
GINT_TO_POINTER (xev->deviceid));
if (!device)
return;
if (xev->property == serial_ids_prop)
{
ClutterInputDeviceTool *tool = NULL;
ClutterInputDeviceToolType type;
guint serial_id;
serial_id = device_get_tool_serial (backend_x11, device);
if (serial_id != 0)
{
tool = g_hash_table_lookup (manager_xi2->tools_by_serial,
GUINT_TO_POINTER (serial_id));
if (!tool)
{
type = clutter_input_device_get_device_type (device) == CLUTTER_ERASER_DEVICE ?
CLUTTER_INPUT_DEVICE_TOOL_ERASER : CLUTTER_INPUT_DEVICE_TOOL_PEN;
tool = clutter_input_device_tool_xi2_new (serial_id, type);
g_hash_table_insert (manager_xi2->tools_by_serial,
GUINT_TO_POINTER (serial_id),
tool);
}
}
clutter_input_device_xi2_update_tool (device, tool);
g_signal_emit_by_name (manager_xi2, "tool-changed", device, tool);
}
}
static ClutterTranslateReturn
clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
gpointer native,
@ -1056,8 +937,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
return CLUTTER_TRANSLATE_REMOVE;
if (!(xi_event->evtype == XI_HierarchyChanged ||
xi_event->evtype == XI_DeviceChanged ||
xi_event->evtype == XI_PropertyEvent))
xi_event->evtype == XI_DeviceChanged))
{
stage = get_event_stage (translator, xi_event);
if (stage == NULL || CLUTTER_ACTOR_IN_DESTRUCTION (stage))
@ -1198,50 +1078,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
stage != NULL)
_clutter_input_device_set_stage (device, stage);
if (clutter_input_device_get_device_type (source_device) == CLUTTER_PAD_DEVICE)
{
/* We got these events because of the passive button grab */
XIAllowEvents (clutter_x11_get_default_display (),
xev->sourceid,
XIAsyncDevice,
xev->time);
/* Ignore 4-7 buttons */
if (xev->detail >= 4 && xev->detail <= 7)
return CLUTTER_TRANSLATE_REMOVE;
event->pad_button.type =
(xi_event->evtype == XI_ButtonPress) ? CLUTTER_PAD_BUTTON_PRESS
: CLUTTER_PAD_BUTTON_RELEASE;
event->pad_button.time = xev->time;
event->pad_button.stage = stage;
/* The 4-7 button range is taken as non-existent on pad devices,
* let the buttons above that take over this range.
*/
if (xev->detail > 7)
xev->detail -= 4;
/* Pad buttons are 0-indexed */
event->pad_button.button = xev->detail - 1;
clutter_event_set_source_device (event, source_device);
CLUTTER_NOTE (EVENT,
"%s: win:0x%x, device:%d '%s', time:%d "
"(button:%d)",
event->any.type == CLUTTER_BUTTON_PRESS
? "pad button press "
: "pad button release",
(unsigned int) stage_x11->xwin,
device->id,
device->device_name,
event->any.time,
event->pad_button.button);
retval = CLUTTER_TRANSLATE_QUEUE;
break;
}
switch (xev->detail)
{
case 4:
@ -1321,8 +1157,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
clutter_event_set_source_device (event, source_device);
clutter_event_set_device (event, device);
clutter_event_set_device_tool (event,
clutter_input_device_xi2_get_current_tool (source_device));
event->button.axes = translate_axes (event->button.device,
event->button.x,
@ -1431,8 +1265,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
clutter_event_set_source_device (event, source_device);
clutter_event_set_device (event, device);
clutter_event_set_device_tool (event,
clutter_input_device_xi2_get_current_tool (source_device));
event->motion.axes = translate_axes (event->motion.device,
event->motion.x,
@ -1634,10 +1466,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
case XI_FocusOut:
retval = CLUTTER_TRANSLATE_CONTINUE;
break;
case XI_PropertyEvent:
handle_property_event (manager_xi2, xi_event);
retval = CLUTTER_TRANSLATE_CONTINUE;
break;
}
return retval;
@ -1815,7 +1643,6 @@ clutter_device_manager_xi2_constructed (GObject *gobject)
XISetMask (mask, XI_HierarchyChanged);
XISetMask (mask, XI_DeviceChanged);
XISetMask (mask, XI_PropertyEvent);
event_mask.deviceid = XIAllDevices;
event_mask.mask_len = sizeof (mask);
@ -1851,16 +1678,6 @@ clutter_device_manager_xi2_set_property (GObject *gobject,
}
}
static ClutterVirtualInputDevice *
clutter_device_manager_xi2_create_virtual_device (ClutterDeviceManager *manager,
ClutterInputDeviceType device_type)
{
return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_X11,
"device-manager", manager,
"device-type", device_type,
NULL);
}
static void
clutter_device_manager_xi2_class_init (ClutterDeviceManagerXI2Class *klass)
{
@ -1888,7 +1705,6 @@ clutter_device_manager_xi2_class_init (ClutterDeviceManagerXI2Class *klass)
manager_class->get_core_device = clutter_device_manager_xi2_get_core_device;
manager_class->get_device = clutter_device_manager_xi2_get_device;
manager_class->select_stage_events = clutter_device_manager_xi2_select_stage_events;
manager_class->create_virtual_device = clutter_device_manager_xi2_create_virtual_device;
}
static void
@ -1897,6 +1713,4 @@ clutter_device_manager_xi2_init (ClutterDeviceManagerXI2 *self)
self->devices_by_id = g_hash_table_new_full (NULL, NULL,
NULL,
(GDestroyNotify) g_object_unref);
self->tools_by_serial = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) g_object_unref);
}

View File

@ -43,7 +43,6 @@ struct _ClutterDeviceManagerXI2
ClutterDeviceManager parent_instance;
GHashTable *devices_by_id;
GHashTable *tools_by_serial;
GSList *all_devices;

View File

@ -1,51 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright © 2016 Red Hat
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#ifdef HAVE_CONFIG_H
#include "clutter-build-config.h"
#endif
#include "clutter-input-device-tool-xi2.h"
G_DEFINE_TYPE (ClutterInputDeviceToolXI2, clutter_input_device_tool_xi2,
CLUTTER_TYPE_INPUT_DEVICE_TOOL)
static void
clutter_input_device_tool_xi2_class_init (ClutterInputDeviceToolXI2Class *klass)
{
}
static void
clutter_input_device_tool_xi2_init (ClutterInputDeviceToolXI2 *tool)
{
}
ClutterInputDeviceTool *
clutter_input_device_tool_xi2_new (guint serial,
ClutterInputDeviceToolType type)
{
return g_object_new (CLUTTER_TYPE_INPUT_DEVICE_TOOL_XI2,
"type", type,
"serial", serial,
NULL);
}

View File

@ -1,74 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright © 2016 Red Hat
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __CLUTTER_INPUT_DEVICE_XI2_TOOL_H__
#define __CLUTTER_INPUT_DEVICE_XI2_TOOL_H__
#include <clutter/clutter-input-device-tool.h>
G_BEGIN_DECLS
#define CLUTTER_TYPE_INPUT_DEVICE_TOOL_XI2 (clutter_input_device_tool_xi2_get_type ())
#define CLUTTER_INPUT_DEVICE_TOOL_XI2(o) \
(G_TYPE_CHECK_INSTANCE_CAST ((o), \
CLUTTER_TYPE_INPUT_DEVICE_TOOL_XI2, ClutterInputDeviceToolXI2))
#define CLUTTER_IS_INPUT_DEVICE_TOOL_XI2(o) \
(G_TYPE_CHECK_INSTANCE_TYPE ((o), \
CLUTTER_TYPE_INPUT_DEVICE_TOOL_XI2))
#define CLUTTER_INPUT_DEVICE_TOOL_XI2_CLASS(c) \
(G_TYPE_CHECK_CLASS_CAST ((c), \
CLUTTER_TYPE_INPUT_DEVICE_TOOL_XI2, ClutterInputDeviceToolXI2Class))
#define CLUTTER_IS_INPUT_DEVICE_TOOL_XI2_CLASS(c) \
(G_TYPE_CHECK_CLASS_TYPE ((c), \
CLUTTER_TYPE_INPUT_DEVICE_TOOL_XI2))
#define CLUTTER_INPUT_DEVICE_TOOL_XI2_GET_CLASS(o) \
(G_TYPE_INSTANCE_GET_CLASS ((o), \
CLUTTER_TYPE_INPUT_DEVICE_TOOL_XI2, ClutterInputDeviceToolXI2Class))
typedef struct _ClutterInputDeviceToolXI2 ClutterInputDeviceToolXI2;
typedef struct _ClutterInputDeviceToolXI2Class ClutterInputDeviceToolXI2Class;
struct _ClutterInputDeviceToolXI2
{
ClutterInputDeviceTool parent_instance;
struct libinput_tablet_tool *tool;
};
struct _ClutterInputDeviceToolXI2Class
{
ClutterInputDeviceToolClass parent_class;
};
GType clutter_input_device_tool_xi2_get_type (void) G_GNUC_CONST;
ClutterInputDeviceTool * clutter_input_device_tool_xi2_new (guint serial,
ClutterInputDeviceToolType type);
G_END_DECLS
#endif /* __CLUTTER_INPUT_DEVICE_XI2_TOOL_H__ */

View File

@ -44,7 +44,6 @@ struct _ClutterInputDeviceXI2
ClutterInputDevice device;
gint device_id;
ClutterInputDeviceTool *current_tool;
};
#define N_BUTTONS 5
@ -80,13 +79,6 @@ clutter_input_device_xi2_keycode_to_evdev (ClutterInputDevice *device,
return TRUE;
}
static gboolean
clutter_input_device_xi2_is_grouped (ClutterInputDevice *device,
ClutterInputDevice *other_device)
{
return FALSE;
}
static void
clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
{
@ -96,7 +88,6 @@ clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
gobject_class->constructed = clutter_input_device_xi2_constructed;
device_class->keycode_to_evdev = clutter_input_device_xi2_keycode_to_evdev;
device_class->is_grouped = clutter_input_device_xi2_is_grouped;
}
static void
@ -181,18 +172,3 @@ _clutter_input_device_xi2_translate_state (ClutterEvent *event,
_clutter_event_set_state_full (event, button, base, latched, locked, effective);
}
void
clutter_input_device_xi2_update_tool (ClutterInputDevice *device,
ClutterInputDeviceTool *tool)
{
ClutterInputDeviceXI2 *device_xi2 = CLUTTER_INPUT_DEVICE_XI2 (device);
g_set_object (&device_xi2->current_tool, tool);
}
ClutterInputDeviceTool *
clutter_input_device_xi2_get_current_tool (ClutterInputDevice *device)
{
ClutterInputDeviceXI2 *device_xi2 = CLUTTER_INPUT_DEVICE_XI2 (device);
return device_xi2->current_tool;
}

View File

@ -41,9 +41,6 @@ void _clutter_input_device_xi2_translate_state (ClutterEvent *event,
XIModifierState *modifiers_state,
XIButtonState *buttons_state,
XIGroupState *group_state);
void clutter_input_device_xi2_update_tool (ClutterInputDevice *device,
ClutterInputDeviceTool *tool);
ClutterInputDeviceTool * clutter_input_device_xi2_get_current_tool (ClutterInputDevice *device);
G_END_DECLS

View File

@ -6,6 +6,7 @@ static const struct {
const char *xsetting_name;
const char *settings_property;
} _clutter_settings_map[] = {
{ "Net/DoubleClickTime", "double-click-time" },
{ "Net/DoubleClickDistance", "double-click-distance" },
{ "Net/DndDragThreshold", "dnd-drag-threshold" },
{ "Gtk/FontName", "font-name" },
@ -15,6 +16,7 @@ static const struct {
{ "Xft/HintStyle", "font-hint-style" },
{ "Xft/RGBA", "font-subpixel-order" },
{ "Fontconfig/Timestamp", "fontconfig-timestamp" },
{ "Gdk/WindowScalingFactor", "window-scaling-factor" },
{ "Gdk/UnscaledDPI", "unscaled-font-dpi" },
};

View File

@ -162,10 +162,10 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11,
&min_height);
if (new_width <= 0)
new_width = min_width;
new_width = min_width * stage_x11->scale_factor;
if (new_height <= 0)
new_height = min_height;
new_height = min_height * stage_x11->scale_factor;
size_hints->flags = 0;
@ -175,8 +175,8 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11,
{
if (resize)
{
size_hints->min_width = min_width;
size_hints->min_height = min_height;
size_hints->min_width = min_width * stage_x11->scale_factor;
size_hints->min_height = min_height * stage_x11->scale_factor;
size_hints->flags = PMinSize;
}
else
@ -236,8 +236,8 @@ clutter_stage_x11_get_geometry (ClutterStageWindow *stage_window,
return;
}
geometry->width = stage_x11->xwin_width;
geometry->height = stage_x11->xwin_height;
geometry->width = stage_x11->xwin_width / stage_x11->scale_factor;
geometry->height = stage_x11->xwin_height / stage_x11->scale_factor;
}
static void
@ -255,8 +255,8 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window,
* so we need to manually set the size and queue a relayout on the
* stage here (as is normally done in response to ConfigureNotify).
*/
stage_x11->xwin_width = width;
stage_x11->xwin_height = height;
stage_x11->xwin_width = width * stage_x11->scale_factor;
stage_x11->xwin_height = height * stage_x11->scale_factor;
clutter_actor_queue_relayout (CLUTTER_ACTOR (stage_cogl->wrapper));
return;
}
@ -277,6 +277,9 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window,
CLUTTER_NOTE (BACKEND, "New size received: (%d, %d)", width, height);
width *= stage_x11->scale_factor;
height *= stage_x11->scale_factor;
if (stage_x11->xwin != None)
{
clutter_stage_x11_fix_window_size (stage_x11, width, height);
@ -397,6 +400,20 @@ set_cursor_visible (ClutterStageX11 *stage_x11)
}
}
static void
on_window_scaling_factor_notify (GObject *settings,
GParamSpec *pspec,
ClutterStageX11 *stage_x11)
{
g_object_get (settings,
"window-scaling-factor", &stage_x11->scale_factor,
NULL);
clutter_stage_x11_resize (CLUTTER_STAGE_WINDOW (stage_x11),
stage_x11->xwin_width,
stage_x11->xwin_height);
}
static void
clutter_stage_x11_unrealize (ClutterStageWindow *stage_window)
{
@ -626,8 +643,12 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
CLUTTER_NOTE (BACKEND, "Wrapper size: %.2f x %.2f", width, height);
CLUTTER_NOTE (BACKEND, "Creating a new Cogl onscreen surface: %.2f x %.2f",
width, height);
width = width * (float) stage_x11->scale_factor;
height = height * (float) stage_x11->scale_factor;
CLUTTER_NOTE (BACKEND, "Creating a new Cogl onscreen surface: %.2f x %.2f (factor: %d)",
width, height,
stage_x11->scale_factor);
stage_x11->onscreen = cogl_onscreen_new (backend->cogl_context, width, height);
@ -888,6 +909,28 @@ clutter_stage_x11_can_clip_redraws (ClutterStageWindow *stage_window)
return stage_x11->clipped_redraws_cool_off == 0;
}
static void
clutter_stage_x11_set_scale_factor (ClutterStageWindow *stage_window,
int factor)
{
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
if (stage_x11->scale_factor == factor)
return;
stage_x11->scale_factor = factor;
clutter_stage_x11_resize (stage_window, stage_x11->xwin_width, stage_x11->xwin_height);
}
static int
clutter_stage_x11_get_scale_factor (ClutterStageWindow *stage_window)
{
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
return stage_x11->scale_factor;
}
static void
ensure_legacy_view (ClutterStageWindow *stage_window)
{
@ -959,6 +1002,8 @@ clutter_stage_x11_class_init (ClutterStageX11Class *klass)
static void
clutter_stage_x11_init (ClutterStageX11 *stage)
{
ClutterSettings *settings;
stage->xwin = None;
stage->xwin_width = 640;
stage->xwin_height = 480;
@ -971,6 +1016,12 @@ clutter_stage_x11_init (ClutterStageX11 *stage)
stage->accept_focus = TRUE;
stage->title = NULL;
settings = clutter_settings_get_default ();
g_signal_connect (settings, "notify::window-scaling-factor",
G_CALLBACK (on_window_scaling_factor_notify),
stage);
on_window_scaling_factor_notify (G_OBJECT (settings), NULL, stage);
}
static void
@ -990,6 +1041,8 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
iface->realize = clutter_stage_x11_realize;
iface->unrealize = clutter_stage_x11_unrealize;
iface->can_clip_redraws = clutter_stage_x11_can_clip_redraws;
iface->set_scale_factor = clutter_stage_x11_set_scale_factor;
iface->get_scale_factor = clutter_stage_x11_get_scale_factor;
iface->get_views = clutter_stage_x11_get_views;
iface->get_frame_counter = clutter_stage_x11_get_frame_counter;
}
@ -1114,8 +1167,8 @@ clutter_stage_x11_translate_event (ClutterEventTranslator *translator,
stage_x11->xwin_height = xevent->xconfigure.height;
}
stage_width = xevent->xconfigure.width;
stage_height = xevent->xconfigure.height;
stage_width = xevent->xconfigure.width / stage_x11->scale_factor;
stage_height = xevent->xconfigure.height / stage_x11->scale_factor;
clutter_actor_set_size (CLUTTER_ACTOR (stage), stage_width, stage_height);
if (size_changed)
@ -1282,10 +1335,10 @@ clutter_stage_x11_translate_event (ClutterEventTranslator *translator,
expose->width,
expose->height);
clip.x = expose->x;
clip.y = expose->y;
clip.width = expose->width;
clip.height = expose->height;
clip.x = expose->x / stage_x11->scale_factor;
clip.y = expose->y / stage_x11->scale_factor;
clip.width = expose->width / stage_x11->scale_factor;
clip.height = expose->height / stage_x11->scale_factor;
clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stage), &clip);
}
break;
@ -1451,8 +1504,8 @@ set_foreign_window_callback (ClutterActor *actor,
fwd->stage_x11->xwin = fwd->xwindow;
fwd->stage_x11->is_foreign_xwin = TRUE;
fwd->stage_x11->xwin_width = fwd->geom.width;
fwd->stage_x11->xwin_height = fwd->geom.height;
fwd->stage_x11->xwin_width = fwd->geom.width * fwd->stage_x11->scale_factor;
fwd->stage_x11->xwin_height = fwd->geom.height * fwd->stage_x11->scale_factor;
clutter_actor_set_size (actor, fwd->geom.width, fwd->geom.height);
@ -1546,8 +1599,8 @@ clutter_x11_set_stage_foreign (ClutterStage *stage,
fwd.geom.x = x;
fwd.geom.y = y;
fwd.geom.width = width;
fwd.geom.height = height;
fwd.geom.width = width / stage_x11->scale_factor;
fwd.geom.height = height / stage_x11->scale_factor;
actor = CLUTTER_ACTOR (stage);

View File

@ -69,6 +69,8 @@ struct _ClutterStageX11
ClutterStageX11State wm_state;
int scale_factor;
guint is_foreign_xwin : 1;
guint fullscreening : 1;
guint is_cursor_visible : 1;

View File

@ -27,9 +27,6 @@
#include <glib-object.h>
#include "clutter-x11.h"
#include "X11/extensions/XTest.h"
#include "clutter-virtual-input-device.h"
#include "x11/clutter-virtual-input-device-x11.h"
@ -64,8 +61,6 @@ clutter_virtual_input_device_x11_notify_button (ClutterVirtualInputDevice *virtu
uint32_t button,
ClutterButtonState button_state)
{
XTestFakeButtonEvent (clutter_x11_get_default_display (),
button, button_state == CLUTTER_BUTTON_STATE_PRESSED, 0);
}
static void
@ -74,21 +69,6 @@ clutter_virtual_input_device_x11_notify_key (ClutterVirtualInputDevice *virtual_
uint32_t key,
ClutterKeyState key_state)
{
XTestFakeKeyEvent (clutter_x11_get_default_display (),
key, key_state == CLUTTER_KEY_STATE_PRESSED, 0);
}
static void
clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t keyval,
ClutterKeyState key_state)
{
KeyCode keycode;
keycode = XKeysymToKeycode (clutter_x11_get_default_display (), keyval);
XTestFakeKeyEvent (clutter_x11_get_default_display (),
keycode, key_state == CLUTTER_KEY_STATE_PRESSED, 0);
}
static void
@ -106,5 +86,4 @@ clutter_virtual_input_device_x11_class_init (ClutterVirtualInputDeviceX11Class *
virtual_input_device_class->notify_absolute_motion = clutter_virtual_input_device_x11_notify_absolute_motion;
virtual_input_device_class->notify_button = clutter_virtual_input_device_x11_notify_button;
virtual_input_device_class->notify_key = clutter_virtual_input_device_x11_notify_key;
virtual_input_device_class->notify_keyval = clutter_virtual_input_device_x11_notify_keyval;
}

View File

@ -42,6 +42,9 @@ m4_define([clutter_release_status],
m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version])
# change this only when breaking the API
m4_define([clutter_api_version], [1.0])
AC_PREREQ([2.63])
AC_INIT([clutter],
@ -58,18 +61,12 @@ AC_CONFIG_MACRO_DIR([build/autotools])
AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar])
AM_SILENT_RULES([yes])
dnl = Check that we are configured by mutter ==============================
AC_ARG_VAR([MUTTER_VERSION])
AC_ARG_VAR([LIBMUTTER_API_VERSION])
AS_IF([test "x$MUTTER_VERSION" = "x"],
[AC_MSG_ERROR([Clutter can only be configured by mutter])],)
AC_SUBST([CLUTTER_MAJOR_VERSION], [clutter_major_version])
AC_SUBST([CLUTTER_MINOR_VERSION], [clutter_minor_version])
AC_SUBST([CLUTTER_MICRO_VERSION], [clutter_micro_version])
AC_SUBST([CLUTTER_VERSION], [clutter_version])
AC_SUBST([CLUTTER_API_VERSION], [clutter_api_version])
AC_SUBST([CLUTTER_API_VERSION_AM], [$CLUTTER_MAJOR_VERSION\_0])
AC_SUBST([CLUTTER_RELEASE_STATUS], [clutter_release_status])
m4_define([lt_current], [m4_eval(100 * clutter_minor_version + clutter_micro_version - clutter_interface_age)])
@ -385,22 +382,6 @@ AS_IF([test "x$SUPPORT_X11" = "x1"],
[AC_MSG_ERROR([not found])]
)
# XTEST (required)
AC_MSG_CHECKING([for XTest extension])
PKG_CHECK_EXISTS([xtst], [have_xtest=yes], [have_xtest=no])
AS_IF([test "x$have_xtest" = "xyes"],
[
AC_DEFINE(HAVE_XTEST, [1], [Define to 1 if we have the XTest X extension])
X11_LIBS="$X11_LIBS -lXtst"
X11_PC_FILES="$X11_PC_FILES xtst"
X11_EXTS="$X11_EXTS xtst"
AC_MSG_RESULT([found])
],
[AC_MSG_ERROR([Not found])]
)
# X Generic Extensions (optional)
clutter_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
@ -784,7 +765,7 @@ AC_CONFIG_FILES([
clutter/Makefile
clutter/clutter-config.h
clutter/clutter-version.h
clutter/mutter-clutter-$LIBMUTTER_API_VERSION.pc:clutter/mutter-clutter.pc.in
clutter/mutter-clutter-$CLUTTER_API_VERSION.pc:clutter/mutter-clutter.pc.in
tests/Makefile
tests/accessibility/Makefile

View File

@ -21,7 +21,7 @@ all_examples += \
image-content
endif
LDADD = $(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(LIBM)
LDADD = $(top_builddir)/clutter/libmutter-clutter-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(LIBM)
AM_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(MAINTAINER_CFLAGS)
AM_CPPFLAGS = \
-DG_DISABLE_SINGLE_INCLUDES \

View File

@ -1,5 +1,5 @@
common_ldadd = \
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la
$(top_builddir)/clutter/libmutter-clutter-@CLUTTER_API_VERSION@.la
common_sources = \
cally-examples-util.c \
@ -11,7 +11,6 @@ AM_CPPFLAGS = \
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \

View File

@ -3,13 +3,12 @@ installed_testdir = $(libexecdir)/installed-tests/mutter-clutter
include $(top_srcdir)/build/autotools/glib-tap.mk
AM_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
LDADD = $(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la $(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la $(CLUTTER_LIBS) $(LIBM)
LDADD = $(top_builddir)/../cogl/cogl/libmutter-cogl.la $(top_builddir)/clutter/libmutter-clutter-1.0.la $(CLUTTER_LIBS) $(LIBM)
AM_LDFLAGS = -export-dynamic
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Clutter-Conform\" \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
@ -79,7 +78,7 @@ script_tests = \
test-script-timeline-markers.json \
test-state-1.json
TESTS_ENVIRONMENT += G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 CLUTTER_SCALE=1
TESTS_ENVIRONMENT += G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0
# simple rules for generating a Git ignore file for the conformance test suite
$(srcdir)/.gitignore: Makefile

View File

@ -350,8 +350,7 @@ actor_replace_child (void)
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "qux");
clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
"name", "foo",
NULL));
"name", "foo"));
clutter_actor_replace_child (actor, iter,
g_object_new (CLUTTER_TYPE_ACTOR,

View File

@ -110,8 +110,8 @@ clean-wrappers:
.PHONY: wrappers clean-wrappers
common_ldadd = \
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la \
$(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la
$(top_builddir)/clutter/libmutter-clutter-@CLUTTER_API_VERSION@.la \
$(top_builddir)/../cogl/cogl/libmutter-cogl.la
check_PROGRAMS = test-interactive
check_SCRIPTS = wrappers
@ -127,7 +127,6 @@ test_interactive_CPPFLAGS = \
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \

View File

@ -1,6 +1,6 @@
common_ldadd = \
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la \
$(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la
$(top_builddir)/clutter/libmutter-clutter-@CLUTTER_API_VERSION@.la \
$(top_builddir)/../cogl/cogl/libmutter-cogl.la
check_PROGRAMS = \
@ -20,7 +20,6 @@ AM_CPPFLAGS = \
-DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \

View File

@ -7,7 +7,7 @@ check_PROGRAMS = \
test-state-mini \
test-state-pick
common_ldadd = $(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la
common_ldadd = $(top_builddir)/clutter/libmutter-clutter-@CLUTTER_API_VERSION@.la
LDADD = $(common_ldadd) $(CLUTTER_LIBS) $(LIBM)
@ -21,7 +21,6 @@ AM_CPPFLAGS = \
-DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \

View File

@ -2,10 +2,8 @@
NULL =
DISTCLEANFILES =
mutterlibdir = $(libdir)/mutter
mutterlib_LTLIBRARIES = libmutter-cogl-gles2-@LIBMUTTER_API_VERSION@.la
mutterlib_LTLIBRARIES = libmutter-cogl-gles2.la
AM_CPPFLAGS = \
-I$(top_srcdir) \
@ -13,8 +11,8 @@ AM_CPPFLAGS = \
AM_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_gles2_@LIBMUTTER_API_VERSION@_la_SOURCES = cogl-gles2-api.c
libmutter_cogl_gles2_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
libmutter_cogl_gles2_la_SOURCES = cogl-gles2-api.c
libmutter_cogl_gles2_la_LDFLAGS = \
-no-undefined \
-rpath $(mutterlibdir) \
-avoid-version \
@ -27,9 +25,7 @@ coglgles2include_HEADERS = \
GLES2/gl2ext.h \
GLES2/gl2platform.h
pc_files = mutter-cogl-gles2-$(LIBMUTTER_API_VERSION).pc
pc_files = mutter-cogl-gles2-1.0.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)

View File

@ -2,12 +2,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@/mutter
includedir=@includedir@/mutter
apiversion=@LIBMUTTER_API_VERSION@
requires=@COGL_PKG_REQUIRES@ mutter-cogl-@LIBMUTTER_API_VERSION@
apiversion=1.0
requires=@COGL_PKG_REQUIRES@ mutter-cogl-1.0
Name: Cogl
Description: An object oriented GL/GLES Abstraction/Utility Layer
Version: @MUTTER_VERSION@
Libs: -L${libdir} -lmutter-cogl-gles2-@LIBMUTTER_API_VERSION@
Version: @COGL_1_VERSION@
Libs: -L${libdir} -lmutter-cogl-gles2
Cflags: -I${includedir}/cogl
Requires: ${requires}

View File

@ -23,13 +23,13 @@ source_h_priv = \
$(NULL)
mutterlibdir = $(libdir)/mutter
mutterlib_LTLIBRARIES = libmutter-cogl-pango-@LIBMUTTER_API_VERSION@.la
mutterlib_LTLIBRARIES = libmutter-cogl-pango.la
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_SOURCES = $(source_c) $(source_h) $(source_h_priv)
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_LIBADD = $(top_builddir)/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_PANGO_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
libmutter_cogl_pango_la_SOURCES = $(source_c) $(source_h) $(source_h_priv)
libmutter_cogl_pango_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_pango_la_LIBADD = $(top_builddir)/cogl/libmutter-cogl.la
libmutter_cogl_pango_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_PANGO_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
libmutter_cogl_pango_la_LDFLAGS = \
-export-dynamic \
-rpath $(mutterlibdir) \
-export-symbols-regex "^cogl_pango_.*" \
@ -49,7 +49,7 @@ cogl_base_includedir = $(includedir)/mutter
cogl_pangoheadersdir = $(cogl_base_includedir)/cogl/cogl-pango
cogl_pangoheaders_HEADERS = $(source_h)
pc_files = mutter-cogl-pango-$(LIBMUTTER_API_VERSION).pc
pc_files = mutter-cogl-pango-1.0.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
@ -65,23 +65,23 @@ INTROSPECTION_GIRS =
if HAVE_INTROSPECTION
INTROSPECTION_COMPILER_ARGS=--includedir=$(top_builddir)/cogl
CoglPango-@LIBMUTTER_API_VERSION@.gir: libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la Makefile
CoglPango-1.0.gir: libmutter-cogl-pango.la Makefile
CoglPango_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = CoglPango
CoglPango_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
CoglPango_@LIBMUTTER_API_VERSION@_gir_LIBS = $(top_builddir)/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la
CoglPango_@LIBMUTTER_API_VERSION@_gir_FILES = $(source_h) $(source_c)
CoglPango_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS)
CoglPango_@LIBMUTTER_API_VERSION@_gir_INCLUDES = Pango-1.0 PangoCairo-1.0
CoglPango_@LIBMUTTER_API_VERSION@_gir_EXPORT_PACKAGES = mutter-cogl-pango-@LIBMUTTER_API_VERSION@
CoglPango_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
CoglPango_1_0_gir_NAMESPACE = CoglPango
CoglPango_1_0_gir_VERSION = 1.0
CoglPango_1_0_gir_LIBS = $(top_builddir)/cogl/libmutter-cogl.la libmutter-cogl-pango.la
CoglPango_1_0_gir_FILES = $(source_h) $(source_c)
CoglPango_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS)
CoglPango_1_0_gir_INCLUDES = Pango-1.0 PangoCairo-1.0
CoglPango_1_0_gir_EXPORT_PACKAGES = mutter-cogl-pango-1.0
CoglPango_1_0_gir_SCANNERFLAGS = \
--warn-all \
--identifier-prefix=CoglPango \
--symbol-prefix=cogl_pango \
--c-include='cogl-pango/cogl-pango.h' \
--include-uninstalled=$(top_builddir)/cogl/Cogl-@LIBMUTTER_API_VERSION@.gir
--include-uninstalled=$(top_builddir)/cogl/Cogl-1.0.gir
INTROSPECTION_GIRS += CoglPango-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += CoglPango-1.0.gir
girdir = $(mutterlibdir)
gir_DATA = $(INTROSPECTION_GIRS)

View File

@ -2,12 +2,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@/mutter
includedir=@includedir@/mutter
apiversion=@LIBMUTTER_API_VERSION@
requires=@COGL_PKG_REQUIRES@ mutter-cogl-@LIBMUTTER_API_VERSION@
apiversion=1.0
requires=@COGL_PKG_REQUIRES@ mutter-cogl-1.0
Name: Cogl
Description: An object oriented GL/GLES Abstraction/Utility Layer
Version: @MUTTER_VERSION@
Libs: -L${libdir} -lmutter-cogl-pango-@LIBMUTTER_API_VERSION@
Version: @COGL_1_VERSION@
Libs: -L${libdir} -lmutter-cogl-pango
Cflags: -I${includedir}/cogl
Requires: ${requires}

View File

@ -65,14 +65,14 @@ glib_enum_headers = $(source_1_x_h)
include $(top_srcdir)/build/autotools/Makefile.am.enums
mutterlibdir = $(libdir)/mutter
mutterlib_LTLIBRARIES = libmutter-cogl-path-@LIBMUTTER_API_VERSION@.la
mutterlib_LTLIBRARIES = libmutter-cogl-path.la
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_SOURCES = $(source_c) $(source_h)
nodist_libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_LIBADD = $(top_builddir)/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
libmutter_cogl_path_la_SOURCES = $(source_c) $(source_h)
nodist_libmutter_cogl_path_la_SOURCES = $(BUILT_SOURCES)
libmutter_cogl_path_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_path_la_LIBADD = $(top_builddir)/cogl/libmutter-cogl.la
libmutter_cogl_path_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
libmutter_cogl_path_la_LDFLAGS = \
-export-dynamic \
-export-symbols-regex "^(cogl|cogl2)_(framebuffer|path|is|clip|[sg]et)_.*" \
-no-undefined \
@ -94,7 +94,7 @@ cogl_pathheadersdir = $(cogl_base_includedir)/cogl/cogl-path
cogl_pathheaders_HEADERS = $(source_h)
nodist_cogl_pathheaders_HEADERS = cogl-path-enum-types.h
pc_files = mutter-cogl-path-$(LIBMUTTER_API_VERSION).pc
pc_files = mutter-cogl-path-1.0.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)

View File

@ -2,12 +2,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@/mutter
includedir=@includedir@/mutter
apiversion=@LIBMUTTER_API_VERSION@
requires=@COGL_PKG_REQUIRES@ mutter-cogl-@LIBMUTTER_API_VERSION@
apiversion=1.0
requires=@COGL_PKG_REQUIRES@ mutter-cogl-1.0
Name: Cogl
Description: A 2D path drawing library for Cogl
Version: @MUTTER_VERSION@
Libs: -L${libdir} -lmutter-cogl-path-@LIBMUTTER_API_VERSION@
Version: @COGL_1_VERSION@
Libs: -L${libdir} -lmutter-cogl-path
Cflags: -I${includedir}/cogl
Requires: ${requires}

View File

@ -41,7 +41,7 @@ BUILT_SOURCES += cogl-defines.h cogl-egl-defines.h cogl-gl-header.h
DISTCLEANFILES += cogl-defines.h cogl-egl-defines.h cogl-gl-header.h
EXTRA_DIST += cogl-defines.h.in cogl-egl-defines.h.in cogl-gl-header.h.in
pc_files = mutter-cogl-$(LIBMUTTER_API_VERSION).pc
pc_files = mutter-cogl-1.0.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
@ -439,23 +439,23 @@ cogl_sources_c += \
endif
mutterlibdir = $(libdir)/mutter
mutterlib_LTLIBRARIES = libmutter-cogl-@LIBMUTTER_API_VERSION@.la
mutterlib_LTLIBRARIES = libmutter-cogl.la
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LIBADD = $(LIBM) $(COGL_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
libmutter_cogl_la_LIBADD = $(LIBM) $(COGL_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
if UNIT_TESTS
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LIBADD += $(top_builddir)/test-fixtures/libtest-fixtures.la
libmutter_cogl_la_LIBADD += $(top_builddir)/test-fixtures/libtest-fixtures.la
endif
# XXX: The aim is to eventually get rid of all private API exports
# for cogl-pango.
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
libmutter_cogl_la_LDFLAGS = \
-no-undefined \
-avoid-version \
-export-dynamic \
-rpath $(mutterlibdir) \
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_texture_set_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_|_cogl_winsys_glx_get_vtable|_cogl_winsys_egl_xlib_get_vtable|_cogl_winsys_egl_get_vtable|_cogl_closure_disconnect|_cogl_onscreen_notify_complete|_cogl_onscreen_notify_frame_sync|_cogl_winsys_egl_renderer_connect_common|_cogl_winsys_error_quark|_cogl_set_error|_cogl_poll_renderer_add_fd|_cogl_poll_renderer_add_idle|_cogl_framebuffer_winsys_update_size|_cogl_winsys_egl_make_current|_cogl_pixel_format_get_bytes_per_pixel).*"
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_|_cogl_winsys_glx_get_vtable|_cogl_winsys_egl_xlib_get_vtable|_cogl_winsys_egl_get_vtable|_cogl_closure_disconnect|_cogl_onscreen_notify_complete|_cogl_onscreen_notify_frame_sync|_cogl_winsys_egl_renderer_connect_common|_cogl_winsys_error_quark|_cogl_set_error|_cogl_poll_renderer_add_fd|_cogl_poll_renderer_add_idle|_cogl_framebuffer_winsys_update_size|_cogl_winsys_egl_make_current).*"
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(cogl_sources_c)
nodist_libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
libmutter_cogl_la_SOURCES = $(cogl_sources_c)
nodist_libmutter_cogl_la_SOURCES = $(BUILT_SOURCES)
# Cogl installed headers
cogl_headers = \
@ -483,22 +483,22 @@ EXTRA_DIST += \
INTROSPECTION_GIRS =
if HAVE_INTROSPECTION
Cogl-@LIBMUTTER_API_VERSION@.gir: libmutter-cogl-$(LIBMUTTER_API_VERSION).la Makefile
Cogl-1.0.gir: libmutter-cogl.la Makefile
Cogl_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Cogl
Cogl_@LIBMUTTER_API_VERSION@_gir_VERSION = $(LIBMUTTER_API_VERSION)
Cogl_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-cogl-$(LIBMUTTER_API_VERSION).la
Cogl_1_0_gir_NAMESPACE = Cogl
Cogl_1_0_gir_VERSION = 1.0
Cogl_1_0_gir_LIBS = libmutter-cogl.la
if UNIT_TESTS
Cogl_@LIBMUTTER_API_VERSION@_gir_LIBS += $(top_builddir)/test-fixtures/libtest-fixtures.la
Cogl_1_0_gir_LIBS += $(top_builddir)/test-fixtures/libtest-fixtures.la
endif
Cogl_@LIBMUTTER_API_VERSION@_gir_FILES = $(cogl_1_public_h)
Cogl_1_0_gir_FILES = $(cogl_1_public_h)
Cogl_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__ -D__COGL_EGL_H_INSIDE__ -D__COGL_GLX_H_INSIDE__ -DCOGL_GIR_SCANNING
Cogl_@LIBMUTTER_API_VERSION@_gir_INCLUDES = GL-1.0 GObject-2.0
Cogl_@LIBMUTTER_API_VERSION@_gir_EXPORT_PACKAGES = mutter-cogl-@LIBMUTTER_API_VERSION@
Cogl_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = --warn-all --c-include='cogl/cogl.h'
Cogl_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__ -D__COGL_EGL_H_INSIDE__ -D__COGL_GLX_H_INSIDE__ -DCOGL_GIR_SCANNING
Cogl_1_0_gir_INCLUDES = GL-1.0 GObject-2.0
Cogl_1_0_gir_EXPORT_PACKAGES = mutter-cogl-1.0
Cogl_1_0_gir_SCANNERFLAGS = --warn-all --c-include='cogl/cogl.h'
INTROSPECTION_GIRS += Cogl-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += Cogl-1.0.gir
girdir = $(mutterlibdir)
gir_DATA = $(INTROSPECTION_GIRS)

View File

@ -81,19 +81,6 @@
#define GL_PURGED_CONTEXT_RESET_NV 0x92BB
#endif
/* These aren't defined in the GLES2 headers */
#ifndef GL_GUILTY_CONTEXT_RESET_ARB
#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
#endif
#ifndef GL_INNOCENT_CONTEXT_RESET_ARB
#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
#endif
#ifndef GL_UNKNOWN_CONTEXT_RESET_ARB
#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
#endif
static void _cogl_context_free (CoglContext *context);
COGL_OBJECT_DEFINE (Context, context);

View File

@ -262,7 +262,6 @@ typedef enum _CoglFeatureID
COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE,
COGL_FEATURE_ID_TEXTURE_RG,
COGL_FEATURE_ID_BUFFER_AGE,
COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL,
/*< private >*/
_COGL_N_FEATURE_IDS /*< skip >*/

View File

@ -55,13 +55,6 @@ struct _CoglDriverVtable
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype);
CoglPixelFormat
(* pixel_format_to_gl_with_target) (CoglContext *context,
CoglPixelFormat format,
CoglPixelFormat target_format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype);
CoglBool
(* update_features) (CoglContext *context,

View File

@ -193,11 +193,6 @@ struct _CoglFramebuffer
CoglFramebufferBits bits;
int samples_per_pixel;
/* Whether the depth buffer was enabled for this framebuffer,
* usually means it needs to be cleared before being reused next.
*/
CoglBool depth_buffer_clear_needed;
};
typedef enum {

View File

@ -117,7 +117,6 @@ _cogl_framebuffer_init (CoglFramebuffer *framebuffer,
framebuffer->viewport_age_for_scissor_workaround = -1;
framebuffer->dither_enabled = TRUE;
framebuffer->depth_writing_enabled = TRUE;
framebuffer->depth_buffer_clear_needed = TRUE;
framebuffer->modelview_stack = cogl_matrix_stack_new (ctx);
framebuffer->projection_stack = cogl_matrix_stack_new (ctx);
@ -269,13 +268,6 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
int scissor_y1;
CoglBool saved_viewport_scissor_workaround;
if (!framebuffer->depth_buffer_clear_needed &&
(buffers & COGL_BUFFER_BIT_DEPTH))
buffers &= ~(COGL_BUFFER_BIT_DEPTH);
if (buffers == 0)
return;
_cogl_clip_stack_get_bounds (clip_stack,
&scissor_x0, &scissor_y0,
&scissor_x1, &scissor_y1);
@ -423,9 +415,6 @@ cleared:
_cogl_framebuffer_mark_mid_scene (framebuffer);
_cogl_framebuffer_mark_clear_clip_dirty (framebuffer);
if (buffers & COGL_BUFFER_BIT_DEPTH)
framebuffer->depth_buffer_clear_needed = FALSE;
if (buffers & COGL_BUFFER_BIT_COLOR && buffers & COGL_BUFFER_BIT_DEPTH)
{
/* For our fast-path for reading back a single pixel of simple

View File

@ -152,7 +152,6 @@ typedef long GLsizeiptr;
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_COVERAGE 0x80A0
#define GL_TEXTURE_EXTERNAL_OES 0x8D65
/* ErrorCode */
#define GL_NO_ERROR 0

View File

@ -111,14 +111,6 @@ _cogl_glsl_shader_set_source_with_boilerplate (CoglContext *ctx,
lengths[count++] = sizeof (texture_3d_extension) - 1;
}
if (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL))
{
static const char texture_3d_extension[] =
"#extension GL_OES_EGL_image_external : require\n";
strings[count] = texture_3d_extension;
lengths[count++] = sizeof (texture_3d_extension) - 1;
}
if (shader_gl_type == GL_VERTEX_SHADER)
{
strings[count] = vertex_boilerplate;

View File

@ -51,9 +51,6 @@ typedef struct _CoglGLXDisplay
CoglBool found_fbconfig;
CoglBool fbconfig_has_rgba_visual;
CoglBool is_direct;
CoglBool have_vblank_counter;
CoglBool can_vblank_wait;
GLXFBConfig fbconfig;
/* Single context for all wins */

View File

@ -43,6 +43,8 @@ typedef struct _CoglGLXRenderer
int glx_error_base;
int glx_event_base;
CoglBool is_direct;
/* Vblank stuff */
int dri_fd;

View File

@ -169,8 +169,7 @@ check_qualcomm_vendor (const CoglGpuInfoStrings *strings)
static CoglBool
check_nvidia_vendor (const CoglGpuInfoStrings *strings)
{
if (strcmp (strings->vendor_string, "NVIDIA") != 0 &&
strcmp (strings->vendor_string, "NVIDIA Corporation") != 0)
if (strcmp (strings->vendor_string, "NVIDIA") != 0)
return FALSE;
return TRUE;

View File

@ -1102,7 +1102,7 @@ upload_vertices (CoglJournal *journal,
attribute_buffer = create_attribute_buffer (journal, needed_vbo_len * 4);
buffer = COGL_BUFFER (attribute_buffer);
cogl_buffer_set_update_hint (buffer, COGL_BUFFER_UPDATE_HINT_DYNAMIC);
cogl_buffer_set_update_hint (buffer, COGL_BUFFER_UPDATE_HINT_STATIC);
vout = _cogl_buffer_map_range_for_fill_or_fallback (buffer,
0, /* offset */

View File

@ -42,7 +42,7 @@
#include <cogl/winsys/cogl-winsys-egl-private.h>
#include <cogl/winsys/cogl-winsys-private.h>
void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglCustomWinsysVtableGetter winsys_vtable_getter);
void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglWinsysVtableGetter winsys_vtable_getter);
#endif /* __COGL_MUTTER_H___ */

View File

@ -44,7 +44,7 @@ typedef struct _CoglObject CoglObject;
/**
* CoglObject: (ref-func cogl_object_ref) (unref-func cogl_object_unref)
* (set-value-func cogl_object_value_set_object)
* (get-value-func cogl_object_value_get_object)
* (get-value-func cogl_object_get_object)
*/
/**

View File

@ -62,7 +62,7 @@ COGL_BEGIN_DECLS
/**
* CoglPrimitive: (ref-func cogl_object_ref) (unref-func cogl_object_unref)
* (set-value-func cogl_object_value_set_object)
* (get-value-func cogl_object_value_get_object)
* (get-value-func cogl_object_get_object)
*/
/**

View File

@ -77,9 +77,6 @@ typedef enum
COGL_PRIVATE_FEATURE_GL_PROGRAMMABLE,
COGL_PRIVATE_FEATURE_GL_EMBEDDED,
COGL_PRIVATE_FEATURE_GL_WEB,
/* This is currently only implemented for GLX, but isn't actually
* that winsys dependent */
COGL_PRIVATE_FEATURE_THREADED_SWAP_WAIT,
COGL_N_PRIVATE_FEATURES
} CoglPrivateFeature;

View File

@ -39,13 +39,12 @@
#include "cogl-texture-driver.h"
#include "cogl-context.h"
#include "cogl-closure-list-private.h"
#include "cogl-mutter.h"
#ifdef COGL_HAS_XLIB_SUPPORT
#include <X11/Xlib.h>
#endif
typedef const CoglWinsysVtable *(*CoglCustomWinsysVtableGetter) (CoglRenderer *renderer);
struct _CoglRenderer
{
CoglObject _parent;
@ -54,7 +53,7 @@ struct _CoglRenderer
const CoglDriverVtable *driver_vtable;
const CoglTextureDriver *texture_driver;
const CoglWinsysVtable *winsys_vtable;
CoglCustomWinsysVtableGetter custom_winsys_vtable_getter;
CoglWinsysVtableGetter custom_winsys_vtable_getter;
CoglWinsysID winsys_id_override;
GList *constraints;
@ -70,7 +69,6 @@ struct _CoglRenderer
Display *foreign_xdpy;
CoglBool xlib_enable_event_retrieval;
CoglBool xlib_want_reset_on_video_memory_purge;
CoglBool xlib_enable_threaded_swap_wait;
#endif
CoglDriver driver;

View File

@ -285,17 +285,6 @@ cogl_xlib_renderer_request_reset_on_video_memory_purge (CoglRenderer *renderer,
renderer->xlib_want_reset_on_video_memory_purge = enable;
}
void
cogl_xlib_renderer_set_threaded_swap_wait_enabled (CoglRenderer *renderer,
CoglBool enable)
{
_COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
/* NB: Renderers are considered immutable once connected */
_COGL_RETURN_IF_FAIL (!renderer->connected);
renderer->xlib_enable_threaded_swap_wait = enable;
}
#endif /* COGL_HAS_XLIB_SUPPORT */
CoglBool
@ -565,8 +554,8 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
/* Final connection API */
void
cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglCustomWinsysVtableGetter winsys_vtable_getter)
cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglWinsysVtableGetter winsys_vtable_getter)
{
renderer->custom_winsys_vtable_getter = winsys_vtable_getter;
}
@ -575,11 +564,10 @@ static CoglBool
connect_custom_winsys (CoglRenderer *renderer,
CoglError **error)
{
const CoglWinsysVtable *winsys;
const CoglWinsysVtable *winsys = renderer->custom_winsys_vtable_getter();
CoglError *tmp_error = NULL;
GString *error_message;
winsys = renderer->custom_winsys_vtable_getter (renderer);
renderer->winsys_vtable = winsys;
error_message = g_string_new ("");

View File

@ -36,6 +36,10 @@
#include "cogl-texture-private.h"
#include "cogl-texture-2d.h"
#ifdef COGL_HAS_EGL_SUPPORT
#include "cogl-egl-defines.h"
#endif
struct _CoglTexture2D
{
CoglTexture _parent;
@ -55,23 +59,30 @@ struct _CoglTexture2D
GLenum gl_internal_format;
/* The texture object number */
GLuint gl_texture;
GLenum gl_target;
GLenum gl_legacy_texobj_min_filter;
GLenum gl_legacy_texobj_mag_filter;
GLint gl_legacy_texobj_wrap_mode_s;
GLint gl_legacy_texobj_wrap_mode_t;
CoglTexturePixel first_pixel;
struct {
void *user_data;
GDestroyNotify destroy;
} egl_image_external;
};
CoglTexture2D *
_cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp,
CoglBool can_convert_in_place);
#if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base)
/* NB: The reason we require the width, height and format to be passed
* even though they may seem redundant is because GLES 1/2 don't
* provide a way to query these properties. */
CoglTexture2D *
_cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int width,
int height,
CoglPixelFormat format,
EGLImageKHR image,
CoglError **error);
#endif
CoglTexture2D *
_cogl_texture_2d_create_base (CoglContext *ctx,
int width,

View File

@ -110,8 +110,6 @@ _cogl_texture_2d_create_base (CoglContext *ctx,
tex_2d->mipmaps_dirty = TRUE;
tex_2d->auto_mipmap = TRUE;
tex_2d->gl_target = GL_TEXTURE_2D;
tex_2d->is_foreign = FALSE;
ctx->driver_vtable->texture_2d_init (tex_2d);
@ -238,12 +236,12 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
* even though they may seem redundant is because GLES 1/2 don't
* provide a way to query these properties. */
CoglTexture2D *
cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int width,
int height,
CoglPixelFormat format,
EGLImageKHR image,
CoglError **error)
_cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int width,
int height,
CoglPixelFormat format,
EGLImageKHR image,
CoglError **error)
{
CoglTextureLoader *loader;
CoglTexture2D *tex;
@ -432,11 +430,11 @@ cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx,
EGL_WAYLAND_BUFFER_WL,
buffer,
NULL);
tex = cogl_egl_texture_2d_new_from_image (ctx,
width, height,
internal_format,
image,
error);
tex = _cogl_egl_texture_2d_new_from_image (ctx,
width, height,
internal_format,
image,
error);
_cogl_egl_destroy_image (ctx, image);
return tex;
}
@ -559,7 +557,7 @@ _cogl_texture_2d_get_gl_texture (CoglTexture *tex,
GLuint handle;
if (out_gl_target)
*out_gl_target = tex_2d->gl_target;
*out_gl_target = GL_TEXTURE_2D;
handle = ctx->driver_vtable->texture_2d_get_gl_handle (tex_2d);

View File

@ -40,10 +40,6 @@
#include "cogl-context.h"
#include "cogl-bitmap.h"
#ifdef COGL_HAS_EGL_SUPPORT
#include "cogl-egl-defines.h"
#endif
COGL_BEGIN_DECLS
/**
@ -231,40 +227,6 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
CoglTexture2D *
cogl_texture_2d_new_from_bitmap (CoglBitmap *bitmap);
#if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base)
/* NB: The reason we require the width, height and format to be passed
* even though they may seem redundant is because GLES 1/2 don't
* provide a way to query these properties. */
CoglTexture2D *
cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int width,
int height,
CoglPixelFormat format,
EGLImageKHR image,
CoglError **error);
typedef gboolean (*CoglTexture2DEGLImageExternalAlloc) (CoglTexture2D *tex_2d,
gpointer user_data,
GError **error);
CoglTexture2D *
cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
int width,
int height,
CoglTexture2DEGLImageExternalAlloc alloc,
gpointer user_data,
GDestroyNotify destroy,
CoglError **error);
void
cogl_texture_2d_egl_image_external_bind (CoglTexture2D *tex_2d);
void
cogl_texture_2d_egl_image_external_alloc_finish (CoglTexture2D *tex_2d,
void *user_data,
GDestroyNotify destroy);
#endif
COGL_END_DECLS
#endif /* __COGL_TEXTURE_2D_H */

View File

@ -198,7 +198,6 @@ struct _CoglTextureDriver
CoglPixelFormat
(* find_best_gl_get_data_format) (CoglContext *context,
CoglPixelFormat format,
CoglPixelFormat target_format,
GLenum *closest_gl_format,
GLenum *closest_gl_type);
};

View File

@ -37,7 +37,6 @@
#include "cogl-spans.h"
#include "cogl-meta-texture.h"
#include "cogl-framebuffer.h"
#include "cogl-texture-2d.h"
#ifdef COGL_HAS_EGL_SUPPORT
#include "cogl-egl-defines.h"
@ -155,8 +154,7 @@ typedef enum _CoglTextureSoureType {
COGL_TEXTURE_SOURCE_TYPE_SIZED = 1,
COGL_TEXTURE_SOURCE_TYPE_BITMAP,
COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE,
COGL_TEXTURE_SOURCE_TYPE_GL_FOREIGN,
COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE_EXTERNAL
COGL_TEXTURE_SOURCE_TYPE_GL_FOREIGN
} CoglTextureSourceType;
typedef struct _CoglTextureLoader
@ -181,14 +179,6 @@ typedef struct _CoglTextureLoader
int height;
CoglPixelFormat format;
} egl_image;
#endif
#if defined (COGL_HAS_EGL_SUPPORT)
struct {
int width;
int height;
CoglTexture2DEGLImageExternalAlloc alloc;
CoglPixelFormat format;
} egl_image_external;
#endif
struct {
int width;

View File

@ -160,7 +160,6 @@ _cogl_texture_free_loader (CoglTexture *texture)
case COGL_TEXTURE_SOURCE_TYPE_SIZED:
case COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE:
case COGL_TEXTURE_SOURCE_TYPE_GL_FOREIGN:
case COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE_EXTERNAL:
break;
case COGL_TEXTURE_SOURCE_TYPE_BITMAP:
cogl_object_unref (loader->src.bitmap.bitmap);
@ -1059,7 +1058,6 @@ cogl_texture_get_data (CoglTexture *texture,
closest_format =
ctx->texture_driver->find_best_gl_get_data_format (ctx,
texture_format,
format,
&closest_gl_format,
&closest_gl_type);

View File

@ -167,36 +167,6 @@ void
cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
CoglBool enable);
/**
* cogl_xlib_renderer_set_threaded_swap_wait_enabled:
* @renderer: a #CoglRenderer
* @enable: The new value
*
* Sets whether Cogl is allowed to use a separate threaded to wait for the
* completion of glXSwapBuffers() and call the frame callback for the
* corresponding #CoglOnscreen. This is a way of emulating the
* INTEL_swap_event extension, and will only ever be used if
* INTEL_swap_event is not present; it will also only be used for
* specific white-listed drivers that are known to work correctly with
* multiple contexts sharing state between threads.
*
* The advantage of enabling this is that it will allow your main loop
* to do other work while waiting for the system to be ready to draw
* the next frame, instead of blocking in glXSwapBuffers(). A disadvantage
* is that the driver will be prevented from buffering up multiple frames
* even if it thinks that it would be advantageous. In general, this
* will work best for something like a system compositor that is doing
* simple drawing but handling lots of other complex tasks.
*
* If you enable this, you must call XInitThreads() before any other
* X11 calls in your program. (See the documentation for XInitThreads())
*
* Stability: unstable
*/
void
cogl_xlib_renderer_set_threaded_swap_wait_enabled (CoglRenderer *renderer,
CoglBool enable);
/**
* cogl_xlib_renderer_get_display: (skip)
*/

View File

@ -1418,15 +1418,6 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
&gl_format,
&gl_type);
/* As we are reading pixels, we want to consider the bitmap according to
* its real pixel format, not the swizzled channels we pretend face to the
* pipeline.
*/
if ((format == COGL_PIXEL_FORMAT_BGRA_8888 ||
format == COGL_PIXEL_FORMAT_BGRA_8888_PRE) &&
_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
gl_format = GL_BGRA;
/* NB: All offscreen rendering is done upside down so there is no need
* to flip in this case... */
if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_MESA_PACK_INVERT) &&

View File

@ -418,11 +418,7 @@ flush_depth_state (CoglContext *ctx,
if (ctx->depth_test_enabled_cache != depth_state->test_enabled)
{
if (depth_state->test_enabled == TRUE)
{
GE (ctx, glEnable (GL_DEPTH_TEST));
if (ctx->current_draw_buffer)
ctx->current_draw_buffer->depth_buffer_clear_needed = TRUE;
}
GE (ctx, glEnable (GL_DEPTH_TEST));
else
GE (ctx, glDisable (GL_DEPTH_TEST));
ctx->depth_test_enabled_cache = depth_state->test_enabled;

View File

@ -46,31 +46,11 @@
#include "cogl-error-private.h"
#include "cogl-util-gl-private.h"
#if defined (COGL_HAS_EGL_SUPPORT)
/* We need this define from GLES2, but can't include the header
as its type definitions may conflict with the GL ones
*/
#ifndef GL_OES_EGL_image_external
#define GL_OES_EGL_image_external 1
#define GL_TEXTURE_EXTERNAL_OES 0x8D65
#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
#define GL_SAMPLER_EXTERNAL_OES 0x8D66
#endif /* GL_OES_EGL_image_external */
#endif /* defined (COGL_HAS_EGL_SUPPORT) */
void
_cogl_texture_2d_gl_free (CoglTexture2D *tex_2d)
{
if (!tex_2d->is_foreign && tex_2d->gl_texture)
_cogl_delete_gl_texture (tex_2d->gl_texture);
#if defined (COGL_HAS_EGL_SUPPORT)
g_clear_pointer (&tex_2d->egl_image_external.user_data,
tex_2d->egl_image_external.destroy);
#endif
}
CoglBool
@ -121,9 +101,6 @@ _cogl_texture_2d_gl_init (CoglTexture2D *tex_2d)
/* Wrap mode not yet set */
tex_2d->gl_legacy_texobj_wrap_mode_s = GL_FALSE;
tex_2d->gl_legacy_texobj_wrap_mode_t = GL_FALSE;
tex_2d->egl_image_external.user_data = NULL;
tex_2d->egl_image_external.destroy = NULL;
}
static CoglBool
@ -462,96 +439,6 @@ allocate_from_gl_foreign (CoglTexture2D *tex_2d,
return TRUE;
}
#if defined (COGL_HAS_EGL_SUPPORT)
static CoglBool
allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
CoglTextureLoader *loader,
CoglError **error)
{
CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context;
CoglPixelFormat internal_format = loader->src.egl_image_external.format;
_cogl_gl_util_clear_gl_errors (ctx);
GE (ctx, glActiveTexture (GL_TEXTURE0));
GE (ctx, glGenTextures (1, &tex_2d->gl_texture));
GE (ctx, glBindTexture (GL_TEXTURE_EXTERNAL_OES,
tex_2d->gl_texture));
if (_cogl_gl_util_get_error (ctx) != GL_NO_ERROR)
{
_cogl_set_error (error,
COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_BAD_PARAMETER,
"Could not create a CoglTexture2D from a given "
"EGLImage");
GE( ctx, glDeleteTextures (1, &tex_2d->gl_texture) );
return FALSE;
}
GE (ctx, glTexParameteri(GL_TEXTURE_EXTERNAL_OES,
GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
GE (ctx, glTexParameteri(GL_TEXTURE_EXTERNAL_OES,
GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
if (!loader->src.egl_image_external.alloc (tex_2d,
tex_2d->egl_image_external.user_data,
error))
{
GE (ctx, glBindTexture (GL_TEXTURE_EXTERNAL_OES, 0));
GE (ctx, glDeleteTextures (1, &tex_2d->gl_texture));
return FALSE;
}
GE (ctx, glBindTexture (GL_TEXTURE_EXTERNAL_OES, 0));
tex_2d->internal_format = internal_format;
tex_2d->gl_target = GL_TEXTURE_EXTERNAL_OES;
return TRUE;
}
CoglTexture2D *
cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
int width,
int height,
CoglTexture2DEGLImageExternalAlloc alloc,
gpointer user_data,
GDestroyNotify destroy,
CoglError **error)
{
CoglTextureLoader *loader;
CoglTexture2D *tex_2d;
CoglPixelFormat internal_format = COGL_PIXEL_FORMAT_ANY;
_COGL_RETURN_VAL_IF_FAIL (_cogl_context_get_winsys (ctx)->constraints &
COGL_RENDERER_CONSTRAINT_USES_EGL,
NULL);
_COGL_RETURN_VAL_IF_FAIL (cogl_has_feature (ctx,
COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL),
NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE_EXTERNAL;
loader->src.egl_image_external.width = width;
loader->src.egl_image_external.height = height;
loader->src.egl_image_external.alloc = alloc;
loader->src.egl_image_external.format = internal_format;
tex_2d = _cogl_texture_2d_create_base (ctx, width, height,
internal_format, loader);
tex_2d->egl_image_external.user_data = user_data;
tex_2d->egl_image_external.destroy = destroy;
return tex_2d;
}
#endif /* defined (COGL_HAS_EGL_SUPPORT) */
CoglBool
_cogl_texture_2d_gl_allocate (CoglTexture *tex,
CoglError **error)
@ -575,8 +462,6 @@ _cogl_texture_2d_gl_allocate (CoglTexture *tex,
#endif
case COGL_TEXTURE_SOURCE_TYPE_GL_FOREIGN:
return allocate_from_gl_foreign (tex_2d, loader, error);
case COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE_EXTERNAL:
return allocate_custom_egl_image_external (tex_2d, loader, error);
}
g_return_val_if_reached (FALSE);
@ -772,12 +657,11 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
upload_format = cogl_bitmap_get_format (upload_bmp);
ctx->driver_vtable->pixel_format_to_gl_with_target (ctx,
upload_format,
_cogl_texture_get_format (tex),
NULL, /* internal gl format */
&gl_format,
&gl_type);
ctx->driver_vtable->pixel_format_to_gl (ctx,
upload_format,
NULL, /* internal format */
&gl_format,
&gl_type);
/* If this touches the first pixel then we'll update our copy */
if (dst_x == 0 && dst_y == 0 &&

View File

@ -37,11 +37,6 @@
#include "cogl-gl-header.h"
#include "cogl-texture.h"
/* In OpenGL ES context, GL_CONTEXT_LOST has a _KHR prefix */
#ifndef GL_CONTEXT_LOST
#define GL_CONTEXT_LOST GL_CONTEXT_LOST_KHR
#endif
#ifdef COGL_GL_DEBUG
const char *

View File

@ -96,12 +96,11 @@ _cogl_driver_pixel_format_from_gl_internal (CoglContext *context,
}
static CoglPixelFormat
_cogl_driver_pixel_format_to_gl_with_target (CoglContext *context,
CoglPixelFormat format,
CoglPixelFormat target_format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype)
_cogl_driver_pixel_format_to_gl (CoglContext *context,
CoglPixelFormat format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype)
{
CoglPixelFormat required_format;
GLenum glintformat = 0;
@ -175,16 +174,7 @@ _cogl_driver_pixel_format_to_gl_with_target (CoglContext *context,
case COGL_PIXEL_FORMAT_BGRA_8888:
case COGL_PIXEL_FORMAT_BGRA_8888_PRE:
glintformat = GL_RGBA;
/* If the driver has texture_swizzle, pretend internal
* and buffer format are the same here, the pixels
* will be flipped through this extension.
*/
if (target_format == format &&
_cogl_has_private_feature
(context, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
glformat = GL_RGBA;
else
glformat = GL_BGRA;
glformat = GL_BGRA;
gltype = GL_UNSIGNED_BYTE;
break;
@ -299,20 +289,6 @@ _cogl_driver_pixel_format_to_gl_with_target (CoglContext *context,
return required_format;
}
static CoglPixelFormat
_cogl_driver_pixel_format_to_gl (CoglContext *context,
CoglPixelFormat format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype)
{
return _cogl_driver_pixel_format_to_gl_with_target (context,
format, format,
out_glintformat,
out_glformat,
out_gltype);
}
static CoglBool
_cogl_get_gl_version (CoglContext *ctx,
int *major_out,
@ -693,7 +669,6 @@ _cogl_driver_gl =
{
_cogl_driver_pixel_format_from_gl_internal,
_cogl_driver_pixel_format_to_gl,
_cogl_driver_pixel_format_to_gl_with_target,
_cogl_driver_update_features,
_cogl_offscreen_gl_allocate,
_cogl_offscreen_gl_free,

View File

@ -114,18 +114,6 @@ _cogl_texture_driver_gen (CoglContext *ctx,
red_swizzle) );
}
/* If swizzle extension is available, prefer it to flip bgra buffers to rgba */
if ((internal_format == COGL_PIXEL_FORMAT_BGRA_8888 ||
internal_format == COGL_PIXEL_FORMAT_BGRA_8888_PRE) &&
_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
{
static const GLint bgra_swizzle[] = { GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA };
GE( ctx, glTexParameteriv (gl_target,
GL_TEXTURE_SWIZZLE_RGBA,
bgra_swizzle) );
}
return tex;
}
@ -533,16 +521,14 @@ static CoglPixelFormat
_cogl_texture_driver_find_best_gl_get_data_format
(CoglContext *context,
CoglPixelFormat format,
CoglPixelFormat target_format,
GLenum *closest_gl_format,
GLenum *closest_gl_type)
{
return context->driver_vtable->pixel_format_to_gl_with_target (context,
format,
target_format,
NULL, /* don't need */
closest_gl_format,
closest_gl_type);
return context->driver_vtable->pixel_format_to_gl (context,
format,
NULL, /* don't need */
closest_gl_format,
closest_gl_type);
}
const CoglTextureDriver

View File

@ -67,12 +67,11 @@ _cogl_driver_pixel_format_from_gl_internal (CoglContext *context,
}
static CoglPixelFormat
_cogl_driver_pixel_format_to_gl_with_target (CoglContext *context,
CoglPixelFormat format,
CoglPixelFormat target_format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype)
_cogl_driver_pixel_format_to_gl (CoglContext *context,
CoglPixelFormat format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype)
{
CoglPixelFormat required_format;
GLenum glintformat;
@ -220,20 +219,6 @@ _cogl_driver_pixel_format_to_gl_with_target (CoglContext *context,
return required_format;
}
static CoglPixelFormat
_cogl_driver_pixel_format_to_gl (CoglContext *context,
CoglPixelFormat format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype)
{
return _cogl_driver_pixel_format_to_gl_with_target (context,
format, format,
out_glintformat,
out_glformat,
out_gltype);
}
static CoglBool
_cogl_get_gl_version (CoglContext *ctx,
int *major_out,
@ -472,7 +457,6 @@ _cogl_driver_gles =
{
_cogl_driver_pixel_format_from_gl_internal,
_cogl_driver_pixel_format_to_gl,
_cogl_driver_pixel_format_to_gl_with_target,
_cogl_driver_update_features,
_cogl_offscreen_gl_allocate,
_cogl_offscreen_gl_free,

View File

@ -615,7 +615,6 @@ static CoglPixelFormat
_cogl_texture_driver_find_best_gl_get_data_format
(CoglContext *context,
CoglPixelFormat format,
CoglPixelFormat target_format,
GLenum *closest_gl_format,
GLenum *closest_gl_type)
{

View File

@ -61,7 +61,6 @@ _cogl_driver_nop =
{
NULL, /* pixel_format_from_gl_internal */
NULL, /* pixel_format_to_gl */
NULL, /* pixel_format_to_gl_with_target */
_cogl_driver_update_features,
_cogl_offscreen_nop_allocate,
_cogl_offscreen_nop_free,

View File

@ -2,12 +2,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@/mutter
includedir=@includedir@/mutter
apiversion=@LIBMUTTER_API_VERSION@
apiversion=1.0
requires=@COGL_PKG_REQUIRES@
Name: Cogl
Description: An object oriented GL/GLES Abstraction/Utility Layer
Version: @MUTTER_VERSION@
Libs: -L${libdir} -lmutter-cogl-@LIBMUTTER_API_VERSION@
Version: @COGL_1_VERSION@
Libs: -L${libdir} -lmutter-cogl
Cflags: -I${includedir}/cogl
Requires: ${requires}

Some files were not shown because too many files have changed in this diff Show More