From c3bcce58a79fd43e2df809826d1d4c3b311dc183 Mon Sep 17 00:00:00 2001 From: sheaf Date: Sun, 25 Apr 2021 01:59:15 +0200 Subject: [PATCH] use ?self to address pointer ownership warnings --- cabal.project | 11 +++++++++++ src/app/MetaBrush/Action.hs | 5 +---- src/app/MetaBrush/Asset/Colours.hs | 1 + src/app/MetaBrush/Event.hs | 5 +++-- src/app/MetaBrush/UI/InfoBar.hs-boot | 2 -- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/cabal.project b/cabal.project index 04fa13a..9f78283 100644 --- a/cabal.project +++ b/cabal.project @@ -24,6 +24,17 @@ package hmatrix -- location: https://github.com/haskell/mtl -- tag: c8af65eb8437aebefd7f3ff1664316a0240f2157 +source-repository-package + type: git + location: https://github.com/haskell-gi/haskell-gi + tag: fad0097a80b942137b7c423f6d9698fff4abeb28 + +source-repository-package + type: git + location: https://github.com/haskell-gi/haskell-gi + tag: fad0097a80b942137b7c423f6d9698fff4abeb28 + subdir: base + -- GHC 9.0 compatibility for 'generics-lens' version 1.2 source-repository-package type: git diff --git a/src/app/MetaBrush/Action.hs b/src/app/MetaBrush/Action.hs index 8cfb49b..eeda55b 100644 --- a/src/app/MetaBrush/Action.hs +++ b/src/app/MetaBrush/Action.hs @@ -67,9 +67,6 @@ import qualified GI.Gdk as GDK -- gi-gio import qualified GI.Gio as GIO --- gi-gobject -import qualified GI.GObject as GObject - -- gi-gtk import qualified GI.Gtk as GTK @@ -1140,7 +1137,7 @@ instance HandleAction KeyboardPress where -> do ---------------------------------------------------------- -- With the pen tool, pressing control moves - -- the partial point control point to the mouse position. + -- the partial path control point to the mouse position. tool <- STM.readTVarIO toolTVar mbMousePos <- STM.readTVarIO mousePosTVar mbPartialPath <- STM.readTVarIO partialPathTVar diff --git a/src/app/MetaBrush/Asset/Colours.hs b/src/app/MetaBrush/Asset/Colours.hs index b46e204..b200b41 100644 --- a/src/app/MetaBrush/Asset/Colours.hs +++ b/src/app/MetaBrush/Asset/Colours.hs @@ -1,6 +1,7 @@ {-# LANGUAGE BlockArguments #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/src/app/MetaBrush/Event.hs b/src/app/MetaBrush/Event.hs index d3840e4..421343a 100644 --- a/src/app/MetaBrush/Event.hs +++ b/src/app/MetaBrush/Event.hs @@ -1,5 +1,6 @@ {-# LANGUAGE BlockArguments #-} {-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE ImplicitParams #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeApplications #-} @@ -70,9 +71,9 @@ handleEvents elts@( UIElements { viewport = Viewport {..}, .. } ) vars = do void $ GTK.afterEventControllerScrollScroll viewportScrollController ( handleScrollEvent elts vars ) void $ GTK.afterGestureClickPressed viewportClicksController - ( handleMouseButtonEvent elts vars eventOrigin viewportClicksController ) + ( handleMouseButtonEvent elts vars eventOrigin ?self ) void $ GTK.afterGestureClickReleased viewportClicksController - ( handleMouseButtonRelease elts vars eventOrigin viewportClicksController ) + ( handleMouseButtonRelease elts vars eventOrigin ?self ) -------------------------------------------------------------------------------- -- Mouse events. diff --git a/src/app/MetaBrush/UI/InfoBar.hs-boot b/src/app/MetaBrush/UI/InfoBar.hs-boot index 5faf452..a63ddc5 100644 --- a/src/app/MetaBrush/UI/InfoBar.hs-boot +++ b/src/app/MetaBrush/UI/InfoBar.hs-boot @@ -6,8 +6,6 @@ module MetaBrush.UI.InfoBar import qualified GI.Gtk as GTK -- MetaBrush -import MetaBrush.Asset.Colours - ( Colours ) import {-# SOURCE #-} MetaBrush.Context ( Variables ) import MetaBrush.Document