From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm0-f50.google.com ([74.125.82.50]) by ur; Thu Jun 30 11:10:24 EDT 2016 Received: by mail-wm0-f50.google.com with SMTP id v199so225529588wmv.0 for <9front@9front.org>; Thu, 30 Jun 2016 08:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=lqVagpF7o6NHzhExzi4z5JKQwZDmvGJDixfrJeGkBLw=; b=D6cnLMWXDkAdf9ksVn78e8Rf2D5OyoiWS7iYuxRY0jujOzEJUAJy56zYc7Px2mzWqz 5WSxKPbMCJHqA1u6sKo3v0Gjt22/wbyEx0Ox4kXGtRRwdBJiLZ79TH2BmD0xugipdOxk 06qI2FN+NrXfKqE5YMNcNx1latkKu2LYyckfP17N14p8R2mDV9DMpLgJqbpHO2cscbpe HJH9gtisjbF9Ss0ltMiT7O1x/RTL3W3sQxme0HO3hmVt8d/0MSn5ERgB+/ydt8fdvIWx j2IskPr6bERP/7pg5zwdDBW5tysBd1vL4PdDZ7fM9zMl79jTfS4U0wuSlkmbE+ztMUlN ZbAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=lqVagpF7o6NHzhExzi4z5JKQwZDmvGJDixfrJeGkBLw=; b=Qzy5c35FIXwJkTlg4r6ZCfG06Q0XzkIUJ5Jd6z+BBpi8dXe8HdM4rTOX9HBH1XNolE G/oGcMuByvCO3gyNGYmx0j3MS6fMatEMSCz5/jvJC3fS9Txmqyqu3Bi5X0YB/YQW1NM9 dRe6anVx9UltFmjWA6sc1lACsDuvOpiv95+Svm91m3b19LoU3n8ohV7Y/0GtymJ1vnkz JpZ77DLefAA5CAl1jhs3WF+DOqD2jZG3DvoYn9S1iZU4+3J82+NotCggI/xxjT2ZnhZY iTOmDPCXo7ZW2aDLkhK0bnfGacgZxGs8WgJxM9WJP7CDJwJb4MGNC1vVOH08kGaX/j3b eGWw== X-Gm-Message-State: ALyK8tIJRYxwP8ZFrlvnlhodRMILkBlUxVCLF3N3pWOLMdj7SaH/dx7ANPYCpE1wO/KHyA== X-Received: by 10.194.104.134 with SMTP id ge6mr16200659wjb.157.1467299420047; Thu, 30 Jun 2016 08:10:20 -0700 (PDT) Return-Path: Received: from u14 ([130.204.142.12]) by smtp.gmail.com with ESMTPSA id r190sm4871049wme.17.2016.06.30.08.10.19 for <9front@9front.org> (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 08:10:19 -0700 (PDT) Date: Thu, 30 Jun 2016 20:07:44 +0200 From: qwx To: 9front@9front.org Subject: doom: re-center mouse more often to limit it escaping Message-ID: <20160630180744.GD28996@u14> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: component-scale XML high-performance template-aware generator doom: re-center mouse more often to limit it escaping when a mouse motion reaches grabout's limits without crossing them, a following event in which the mouse passes the remaining distance between grabout and the window's limits will have the mouse jump out of the window. this happens too frequently on terminals with a good drawing speed. to reduce this, make grabout smaller, so that the distance to cross in one event is larger. Dx(screen->r)/4 is sufficient for the terminals i have tested this on. diff -r 0a3cf47fce65 sys/src/games/doom/i_video.c --- a/sys/src/games/doom/i_video.c Mon Jun 27 00:36:54 2016 +0200 +++ b/sys/src/games/doom/i_video.c Thu Jun 30 17:51:32 2016 +0300 @@ -44,7 +44,7 @@ draw(screen, screen->r, display->black, nil, ZP); center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2)); - grabout = insetrect(screen->r, Dx(screen->r)/8); + grabout = insetrect(screen->r, Dx(screen->r)/4); if((pid = rfork(RFPROC|RFMEM)) == 0){ kbdproc(); @@ -102,7 +102,7 @@ draw(screen, screen->r, display->black, nil, ZP); center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2)); - grabout = insetrect(screen->r, Dx(screen->r)/8); + grabout = insetrect(screen->r, Dx(screen->r)/4); } scale = Dx(screen->r)/SCREENWIDTH;