Git Product home page Git Product logo

Comments (7)

geekosaur avatar geekosaur commented on June 9, 2024

My suspicion is that the drag was never completed and crashes when the window goes away. Do we check for this?

from xmonad.

slotThe avatar slotThe commented on June 9, 2024

(The ones that are caught don't include an executable name; they just print the exception as is.)

I don't think that this is true. I can reproduce the spam of

user error (Error in function getWindowAttributes)

once the window goes away, but can't reproduce the crash at all. Indeed, making the following change

diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs
index 631f847..0c6b5a5 100644
--- a/src/XMonad/Core.hs
+++ b/src/XMonad/Core.hs
@@ -196,7 +196,7 @@ catchX job errcase = do
     c <- ask
     (a, s') <- io $ runX c st job `E.catch` \e -> case fromException e of
                         Just (_ :: ExitCode) -> throw e
-                        _ -> do hPrint stderr e; runX c st errcase
+                        _ -> do hPrint stderr ("CAUGHT: " <> show e); runX c st errcase
     put s'
     return a

and going over the recipe again correctly prints

"CAUGHT: user error (Error in function getWindowAttributes)"

to stderr. These exceptions seem to be correctly caught inside of some userCode call.

from xmonad.

geekosaur avatar geekosaur commented on June 9, 2024

Isn't that what I said about the usual ones? The point is that somewhere there's an uncaught one. I'll probably need to do a profiling build and a reproducer to spot the one that leaked.

from xmonad.

slotThe avatar slotThe commented on June 9, 2024

Oh sorry, my brain must have s/executable name/function name/'d

from xmonad.

slotThe avatar slotThe commented on June 9, 2024

Can you consistently reproduce this with the above setup? If yes, and you think it's really the dragging, perhaps try adding an explicit userCodeDef to the dragging code

diff --git a/src/XMonad/Operations.hs b/src/XMonad/Operations.hs
index 9101cc0..7ff44df 100644
--- a/src/XMonad/Operations.hs
+++ b/src/XMonad/Operations.hs
@@ -783,9 +783,7 @@ mouseDragCursor cursorGlyph f done = do
         withDisplay $ io . flip ungrabPointer currentTime
         modify $ \s -> s { dragging = Nothing }
         done
-    motion x y = do z <- f x y
-                    clearEvents pointerMotionMask
-                    return z
+    motion x y = userCodeDef () (f x y) >>= \z -> z <$ clearEvents pointerMotionMask
 
 -- | Drag the window under the cursor with the mouse while it is dragged.
 mouseMoveWindow :: Window -> X ()

from xmonad.

geekosaur avatar geekosaur commented on June 9, 2024

I can't reproduce it now for some reason: I get the mis-sized window, but it drags for both move and resize fine. I wonder what went wrong the first time.

from xmonad.

geekosaur avatar geekosaur commented on June 9, 2024

Curiously, I arranged for a dialog to disappear on xmonad during a drag and can't reproduce even that way. (The original circumstances I am assuming are due to some weirdness in my setup that I can't reliably reproduce and seems to be tied to something completely unrelated, so I haven't bothered to report it.)

Closing for now.

from xmonad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.