* subcompositor.c (ViewAttachBuffer): Correctly determine when
to recompute view bounds.
* subsurface.c (AfterParentCommit): Unskip view first, and
commit pending state second. Explain why.
* xdg_toplevel.c (Unmap, Map): Add new "initial configure" flag.
(Commit): Use it instead of testing current_buffer. Explain
why.
(XLGetXdgToplevel): Set that flag by default.
* compositor.h: Update prototypes.
* idle_inhibit.c (DetectSurfaceIdleInhibit): Handle subsurfaces;
when an inhibitor attached to a subsurface is displayed, check
if the subsurface's root is focused or not.
(CreateInhibitor): Likewise; handle subsurfaces specially.
* subcompositor.c (ViewisVisible): New function.
* subsurface.c (struct _Subsurface): New field `mapped'.
(Commit, Teardown): Update idle inhibition when the surface is
mapped or unmapped.
(XLSubsurfaceGetRoot): New function.
* 12to11.c (XLMain): Initialize keyboard shortcut inhibition.
* Imakefile (SRCS): Add keyboard_shortcuts_inhibit.c.
(OBJS): Add keyboard_shortcuts_inhibit.o.
* compositor.h (enum _ClientDataType): Add ShortcutInhibitData.
(struct _ClientData): New structure.
(struct _Surface): Make client data a linked list.
* pointer_constraints.c (Reconfine, XLPointerBarrierLeft)
(XLPointerBarrierCheck, XLPointerConstraintsSurfaceMovedTo):
Adjust to new client data storage approach.
* seat.c (struct _Seat): New fields `last_focus_time' and
`external_grab_time'.
(HandleBind, SelectDeviceEvents, SetFocusSurface): Use size_t to
represent mask length.
(DispatchFocusIn): Set last focus time.
(FakePointerEdge, XLSelectStandardEvents): Likewise; use size_t.
(XLSeatExplicitlyGrabSurface): Clear active grab.
(XLSeatBeginDrag): Use size_t to represent XI mask length.
(XLSeatApplyExternalGrab, XLSeatCancelExternalGrab): New
functions.
* subsurface.c (Teardown, XLSubsurfaceHandleParentCommit):
Adjust client data storage.
* surface.c (HandleSurfaceDestroy, XLSurfaceGetClientData):
Adjust client data storage to use a linked list.
(XLSurfaceFindClientData): New function.
* text_input.c (FilterInputCallback): Pacify cppcheck.
* compositor.h: Update prototypes.
* dmabuf.c (MakeFeedback): Fix comment.
* shm.c (Pool): New field `flags'.
(DereferencePool, ResizePool, CreatePool): Detect whether or not
accessing a pool cannot result in SIGBUS, and refrain from
adding bus traps if that is the case.
* subcompositor.c (IsSkipped, SetSkipped, ClearSkipped): New
view state.
(SubcompositorUpdateBounds, SubcompositorUpdateBoundsForInsert)
(ViewRecomputeChildren, ViewAfterSizeUpdate, ViewMove, ViewFree)
(SubcompositorUpdate, SubcompositorExpose,
SubcompositorLookupView): Skip "skipped" views.
* subsurface.c (AfterParentCommit): Unskip views.
(Setup): Mark view as unskipped.
* 12to11.c (XLMain): Initialize wp_viewporter.
* Imakefile (ETAGS): Remove unused variable.
(SRCS, OBJS): Add wp_viewporter.c and wp_viewporter.o.
(GENHEADERS): Remove unnecessary headers.
(viewporter): New scanner target.
* README: Document support for wp_viewporter.
* compositor.h (struct _ViewportExt): New forward declaration.
(struct _DrawParams): New fields for cropping and stretching.
(struct _RenderFuncs): Describe how composite works.
(struct _BufferFuncs): Make update_buffer_for_damage take
DrawParams as an argument.
(struct _State): New fields for viewporting.
(struct _Surface): New field `viewport' and associated input
delta.
(struct _XdgRoleImplementationFuncs): New field
`is_window_mapped'. Do not commit while unmapped.
* dmabuf.c (XLInitDmabuf): Remove outdated comment.
* dnd.c (HandleMotion): Use TruncateWindowToSurface.
* egl.c (struct _EglBuffer): Add 3x3 reverse transformation
matrix.
(struct _CompositeProgram): Rename `scale' to `source'.
(Index): New macro.
(PickBetterVisual, FindVisual): Compensate for EGL picking a
non-RGBA visual.
(EglCompileCompositeProgram): Look for source, not scale.
(ComputeTransformMatrix): New function.
(Composite): Compute transformation matrix and draw using that.
(BufferFromDmaBuf, BufferFromShm): Copy identity transform and
stop setting scale.
(ReverseTransformToBox): New function.
(UpdateShmBufferIncrementally): Accept DrawParams and invert
damage according to that.
(UpdateBuffer, UpdateBufferForDamage): Pass draw params to the
incremental buffer update function.
* fns.c (XLExtendRegion): New function.
* frame_clock.c (CurrentHighPrecisionTimestamp): Delete
function.
(HighPrecisionTimestamp, HighPrecisionTimestamp32): New
functions.
(PostEndFrame): Handle X server time truncation to 32 bits.
(XLFrameClockFreeze): Remove trailing whitespace.
* picture_renderer.c (GetSourceX, GetSourceY, CompareStretch):
New functions.
(MaybeApplyTransform): Check more values before applying
transformations. Then, handle stretch and offset.
* positioner.c (GetAdjustmentOffset, ApplyConstraintAdjustment)
(XLPositionerCalculateGeometry): Scale coordinates using new
functions.
* renderer.c (RenderUpdateBufferForDamage): Accept DrawParams
instead of scale.
* shaders.txt (Composite Rectangle Fragment Shader RGBA)
(Composite Rectangle Fragment Shader RGBX)
(Composite Rectangle Fragment Shader External): Stop
transforming texcoords.
(Composite Rectangle Vertex Shader): Transform texcoords in the
vertex shader instead.
* subcompositor.c (IsViewported, SetViewported,
ClearViewported): New functions.
(struct _View): New fields for tracking viewports and fractional
offsets.
(ViewAttachBuffer): Do not garbage upon buffer size change if a
viewport is set.
(ViewMoveFractional): New function.
(ViewDamage): Describe what the damage is and is not transformed
by.
(GetContentScale): New function.
(ViewWidth, ViewHeight): Apply viewport.
(ViewSetScale): Use ViewAfterSizeUpdate instead of duplicating
code.
(ViewSetViewport, ViewClearViewport): New functions.
(ViewComputeTransform): Compute transform for viewports. New
arg draw; use it to determine whether or not to include a
fractional offset.
(IntersectBoxes): Fix intersection calculation.
(SubcompositorUpdate): Don't keep calling ViewWidth and
ViewHeight in a loop.
(SubcompositorExpose): Adjust for changes to buffer damage
uploading.
* subsurface.c (MoveFractional): New function. Handle
fractional offsets after scaling.
(MaybeUpdateOutputs, AfterParentCommit, Setup, Rescale): Use
that function to move the subsurface instead.
* surface.c (ApplyScale): Update comment.
(ApplyViewport, CheckViewportValues): New functions.
(HandleScaleChanged): Apply the viewport as well upon scale
change.
(ApplyDamage): Improve damage calculation for viewported
surfaces.
(SavePendingState, InternalCommit): Save and commit viewport
state; check old values upon buffer commit.
(InitState): Initialize viewport to initial values.
(XLSurfaceRunFrameCallbacks): Handle overflows of 32-bit time at
the 49-day mark.
(SurfaceToWindow, ScaleToWindow, WindowToSurface, ScaleToSurface)
(TruncateScaleToWindow, TruncateScaleToWindow)
(TruncateWindowToSurface, TruncateScaleToSurface): New functions
for handling scale.
* xdg_popup.c (MoveWindow, IsWindowMapped, XLGetXdgPopup):
* xdg_surface.c (IsRoleMapped, Commit, Subframe)
(GetResizeDimensions, XLXdgRoleCalcNewWindowSize):
* xdg_toplevel.c (IsWindowMapped, NoteConfigureTime, SendStates)
(RecordStateSize, HandleWindowGeometryChange, NoteWindowPreResize)
(XLGetXdgToplevel): Use them instead of manually multiplying
with the factor.