Skip to content
Snippets Groups Projects
Commit 02b18cf8 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Opengl_Window should not take the keyboard focus by force as soon the
mouse enters its area (this messes up the processing of other windows
shortcuts). Instead, it should only force the focus when it gets a
mouse click. This is much nicer.
parent f7008b44
Branches
Tags
No related merge requests found
// $Id: Colorbar_Window.cpp,v 1.46 2004-12-31 04:04:50 geuzaine Exp $ // $Id: Colorbar_Window.cpp,v 1.47 2004-12-31 06:01:35 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -352,13 +352,15 @@ int Colorbar_Window::handle(int event) ...@@ -352,13 +352,15 @@ int Colorbar_Window::handle(int event)
switch (event) { switch (event) {
case FL_FOCUS: // accept focus events when asked
case FL_UNFOCUS:
return 1;
case FL_ENTER: case FL_ENTER:
take_focus(); //force keyboard focus on the ColorbarWindow take_focus(); // force keyboard focus as soon as the mouse enters
return 1; return 1;
case FL_LEAVE: case FL_LEAVE:
case FL_FOCUS:
case FL_UNFOCUS:
return 1; return 1;
case FL_SHORTCUT: case FL_SHORTCUT:
......
// $Id: Opengl_Window.cpp,v 1.43 2004-12-24 03:25:37 geuzaine Exp $ // $Id: Opengl_Window.cpp,v 1.44 2004-12-31 06:01:35 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -132,16 +132,7 @@ int Opengl_Window::handle(int event) ...@@ -132,16 +132,7 @@ int Opengl_Window::handle(int event)
switch (event) { switch (event) {
case FL_ENTER: case FL_FOCUS: // accept the focus when I'm asked if I want it
take_focus(); //force keyboard focus on the Opengl_Window
return 1;
case FL_LEAVE:
return 1;
case FL_FOCUS:
return 1;
case FL_UNFOCUS: case FL_UNFOCUS:
return 1; return 1;
...@@ -154,6 +145,7 @@ int Opengl_Window::handle(int event) ...@@ -154,6 +145,7 @@ int Opengl_Window::handle(int event)
return Fl_Gl_Window::handle(event); return Fl_Gl_Window::handle(event);
case FL_PUSH: case FL_PUSH:
take_focus(); // force keyboard focus when we click in the window
FirstClick = 1; FirstClick = 1;
ibut = Fl::event_button(); ibut = Fl::event_button();
xpos = Fl::event_x(); xpos = Fl::event_x();
...@@ -295,7 +287,6 @@ int Opengl_Window::handle(int event) ...@@ -295,7 +287,6 @@ int Opengl_Window::handle(int event)
ypos += ymov; ypos += ymov;
return 1; return 1;
case FL_MOVE: case FL_MOVE:
xmov = Fl::event_x() - xpos; xmov = Fl::event_x() - xpos;
ymov = Fl::event_y() - ypos; ymov = Fl::event_y() - ypos;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment