Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make window movement more robuust against fast movements of the mouse pointer #15

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 14 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Move the window across the screen very quickly
2. Boom

gdb:


Program received signal SIGSEGV, Segmentation fault.
0x00007ffff76ac4b3 in std::_Rb_tree_increment(std::_Rb_tree_node_base const*) 
() from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0  0x00007ffff76ac4b3 in std::_Rb_tree_increment(std::_Rb_tree_node_base 
const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00000000004277c1 in std::_Rb_tree_const_iterator<DrawData>::operator++ 
(this=0x7fffffffdfb0) at /usr/include/c++/4.7/bits/stl_tree.h:277
#2  0x0000000000425a8f in Viewport::OnDraw (this=0x7c9d30) at viewport.cpp:1220
#3  0x000000000042eb4d in UpdateWindows () at window.cpp:885
#4  0x000000000042ec0d in WindowManager::Tick (this=0x69ca80) at window.cpp:906
#5  0x0000000000405c1a in main () at main.cpp:125


Original issue reported on code.google.com by CharlesP...@googlemail.com on 16 Dec 2012 at 5:26

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

It only happens when you move the window up and it is not required to move it 
very fast. Actually, it doesn't segfault only when you move it extremely slow.

Original comment by mkr...@gmail.com on 18 Dec 2012 at 11:37

@GoogleCodeExporter
Copy link
Author

Original comment by CharlesP...@googlemail.com on 28 Dec 2012 at 2:17

  • Changed title: Seg faults when moving window up at any sort of speed

@GoogleCodeExporter
Copy link
Author

Original comment by CharlesP...@googlemail.com on 28 Dec 2012 at 2:18

  • Changed title: Seg faults when moving window upwards at any sort of speed

@GoogleCodeExporter
Copy link
Author

Should be fixed in r642

Original comment by Alberth2...@gmail.com on 30 Dec 2012 at 1:51

@GoogleCodeExporter
Copy link
Author

Sorry to inform you, but now when you try moving the window upwards, the cursor 
just loses it as if the mouse button was released: the window moves a few 
pixels and then stops, and the cursor continues going.

Original comment by mkr...@gmail.com on 31 Dec 2012 at 2:56

@GoogleCodeExporter
Copy link
Author

Yeah it does, but it does not seg-fault any more, which is what the issue was 
about.

What happened is that during the move, the mouse cursor left the window you are 
moving, so the game switched to another window, namely the main display under 
it, and started moving that window. Together with not clipping the window to 
the screen, the draw code caused data corruption in other memory parts, giving 
segmentation faults etc.
This is what I wanted to fix; crashes are very annoying.

I don't understand how it manages to switch windows, it should not be possible. 
Finding out how that happens will be done another day. As a work-around, move 
your mouse to the bottom of the title bar before the drag, and/or don't move 
too fast.

Original comment by Alberth2...@gmail.com on 31 Dec 2012 at 10:47

  • Changed title: Make window movement more robuust against fast movements of the mouse pointer
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Issue 19 has been merged into this issue.

Original comment by CharlesP...@googlemail.com on 4 Jul 2013 at 11:30

@GoogleCodeExporter
Copy link
Author

I fixed the window moving.
The UpdateCurrentWindow method will change the current window if you move to 
fast. In my opinion it should only be called in WMMM_PASS_THROUGH mode, because 
when you click on a window, it should follow your mouse untill you unclick it.
So you don't have to call UpdateCurrentWindow when dragging a window.

Original comment by tnt.free...@gmail.com on 19 Jul 2013 at 11:27

Attachments:

@GoogleCodeExporter
Copy link
Author

The patch does not apply. You seem to have a different TAB width, and replace 
TAB characters by spaces.

Since the project uses TAB characters as leading white space, that makes 
applying the patch impossible.

Could you please make a patch that uses TABs as leading white space?

Original comment by Alberth2...@gmail.com on 20 Jul 2013 at 2:14

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

My bad, vim seems to replace tabs with spaces in the file.
Here is the patch with tabs.

Original comment by tnt.free...@gmail.com on 20 Jul 2013 at 4:02

Attachments:

@GoogleCodeExporter
Copy link
Author

Applied your patch in r789, thanks for the fix.

Please watch out for trailing white space (causing spurious "this->mouse_pos = 
pos;" replacement), and empty lines at the end that got added.

I use

set list
set listchars=tab:>-,trail:<

In .vimrc to see whitespace problems, and always check the produced patch for 
weird additions (It amazing how much you find that way :) ).

Original comment by Alberth2...@gmail.com on 22 Jul 2013 at 9:43

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Will do in the future, thanks.

Original comment by tnt.free...@gmail.com on 22 Jul 2013 at 11:43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant