Merge lp:~sao/unity/doubleclick_on_panel_to_unmaximize into lp:unity

Proposed by Oliver Sauder
Status: Merged
Merged at revision: 918
Proposed branch: lp:~sao/unity/doubleclick_on_panel_to_unmaximize
Merge into: lp:unity
Diff against target: 34 lines (+3/-3)
2 files modified
src/PanelTitlebarGrabAreaView.cpp (+2/-2)
src/PanelTitlebarGrabAreaView.h (+1/-1)
To merge this branch: bzr merge lp:~sao/unity/doubleclick_on_panel_to_unmaximize
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+52150@code.launchpad.net

Description of the change

The mouse events from the Nux InputArea seem to be a bit "bumpy" (also mentioned in some FIXME in the unity code).

The OnMouseClick is only emitted when _event_processor.MouseIn() is true, which does not apply when clicking on the left side of the title bar.

Therefore, as a workaround I've replaced the OnMouseClick event with OnMouseUp to implement the double click behavior. In the long run I suppose it would be desirable to fix the mouse events in Nux.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

right about the FIXME, I had to do that manually in the code as you have been able to know. :)

Nice track about the _event_processor.MouseIn()! So let's go with OnMouseUp now! Approved! Thanks a bunch :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PanelTitlebarGrabAreaView.cpp'
2--- src/PanelTitlebarGrabAreaView.cpp 2011-02-08 14:18:09 +0000
3+++ src/PanelTitlebarGrabAreaView.cpp 2011-03-04 00:38:53 +0000
4@@ -48,7 +48,7 @@
5 // right now and we need jay to focus on other things
6 /*InputArea::EnableDoubleClick (true);
7 InputArea::OnMouseDoubleClick.connect (sigc::mem_fun (this, &PanelTitlebarGrabArea::RecvMouseDoubleClick));*/
8- InputArea::OnMouseClick.connect (sigc::mem_fun (this, &PanelTitlebarGrabArea::RecvMouseClick));
9+ InputArea::OnMouseUp.connect (sigc::mem_fun (this, &PanelTitlebarGrabArea::RecvMouseUp));
10 _last_click_time.tv_sec = 0;
11 _last_click_time.tv_nsec = 0;
12
13@@ -78,7 +78,7 @@
14 }
15
16 // TODO: can be safely removed once OnMouseDoubleClick is fixed in nux
17-void PanelTitlebarGrabArea::RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags)
18+void PanelTitlebarGrabArea::RecvMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags)
19 {
20 struct timespec event_time, delta;
21 clock_gettime(CLOCK_MONOTONIC, &event_time);
22
23=== modified file 'src/PanelTitlebarGrabAreaView.h'
24--- src/PanelTitlebarGrabAreaView.h 2011-02-08 14:18:09 +0000
25+++ src/PanelTitlebarGrabAreaView.h 2011-03-04 00:38:53 +0000
26@@ -46,7 +46,7 @@
27 void RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags);
28 void RecvMouseDoubleClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
29 // TODO: can be safely removed once OnMouseDoubleClick is fixed in nux
30- void RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
31+ void RecvMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags);
32 struct timespec time_diff (struct timespec start, struct timespec end);
33
34 struct timespec _last_click_time;