Nux

Merge lp://qastaging/~azzar1/nux/please-dont-focus-me-on-mouse-down into lp://qastaging/nux/2.0

Proposed by Andrea Azzarone
Status: Merged
Approved by: Jay Taoko
Approved revision: 533
Merged at revision: 533
Proposed branch: lp://qastaging/~azzar1/nux/please-dont-focus-me-on-mouse-down
Merge into: lp://qastaging/nux/2.0
Diff against target: 326 lines (+193/-5)
8 files modified
Nux/BaseWindow.cpp (+2/-0)
Nux/InputArea.cpp (+11/-0)
Nux/InputArea.h (+4/-0)
Nux/WindowCompositor.cpp (+1/-1)
configure.ac (+1/-1)
tests/Makefile.am (+15/-2)
tests/Readme.txt (+2/-1)
tests/focus-on-mouse-down-test.cpp (+157/-0)
To merge this branch: bzr merge lp://qastaging/~azzar1/nux/please-dont-focus-me-on-mouse-down
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Tim Penhey (community) Approve
Review via email: mp+86175@code.qastaging.launchpad.net

Description of the change

Adds a way to disable the focus on mouse down behaviour. Adds a simple test too.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Looks good.

review: Approve
Revision history for this message
Jay Taoko (jaytaoko) wrote :

There is no need to have Area::AcceptKeyNavFocusOnMouseDown use GetInputEventSensitivity().
Area::AcceptKeyNavFocus() uses GetInputEventSensitivity() already.

I propose the following

class InputArea
{

  virtual bool AcceptKeyNavFocusOnMouseDown();
  void SetAcceptKeyNavFocusOnMouseDown(bool accept);

  bool accept_key_nav_focus_on_mouse_down_;
}

InputArea::InputArea()
{
  accept_key_nav_focus_on_mouse_down_ = true;
}

bool InputArea::AcceptKeyNavFocusOnMouseDown()
{
  return accept_key_nav_focus_on_mouse_down_;
}

void InputArea::SetAcceptKeyNavFocusOnMouseDown(bool accept)
{
  accept_key_nav_focus_on_mouse_down_ = accept;
}

BaseWindow::BaseWindow(...)
{

  SetAcceptKeyNavFocusOnMouseDown(false);

}

That way we can also get other Views to not get the focus on mouse down events if there is a need for it. Not just BaseWindows. Let me know if this still works with your branch.

There is a similar problem with InputArea::AcceptKeyNavFocus(). I will re-factor it to work like SetAcceptKeyNavFocusOnMouseDown.

review: Needs Fixing
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Done.

530. By Andrea Azzarone

Makes sure that the scroll wheel works with nux::VScrollbar. Fixes: https://bugs.launchpad.net/bugs/888819. Appoved by Jay Taoko.

531. By Jay Taoko

Added separate file for GLib main loop functions
* Cleanup: variable renaming
* Marked some functions as obsolete
* Core objects take the WindowThread as a constructor parameters: Painter, WindowCompositor.... Fixes: . Appoved by Jason Smith.

532. By Jay Taoko

* Removed API:
   GraphicsDisplay& GetWindow();
   GraphicsEngine& GetGraphicsEngine();
   NThread* GetThreadApplication();
   WindowThread* GetGraphicsThread();

* Modified code to to use GetWindowThread() to access its internal objects.

* Added tests:
   - WindowThread
   - StaticText
. Fixes: . Appoved by Jason Smith.

533. By Andrea Azzarone

Adds the possiblity to don't get the focus on mouse down.

Revision history for this message
Jay Taoko (jaytaoko) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: