kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Fl::focus on OS X
* Correct a Fl::focus error on OS X
- Fl::focus returns an erroneous pointer to a
window not owned by fldigi when the OS X
"About This Mac" dialog display in front of the
main fldigi dialog. The ATM dialog is forced to
front focus. Calls like w->window() then points
to memory outside of the application allocation.
- correct solution is to use named_window->contains(w)
where named_window is an existing fldigi widget and
w is the widget returned by Fl::focus().
- contains returns 1 if named_window or any of it's
child windows are in that window "group"
pull/1/head
rodzic
67948117a0
commit
59a90297df
|
|
@ -2627,36 +2627,37 @@ int default_handler(int event)
|
|||
|
||||
if ((key == FL_F + 4) && Fl::event_alt()) clean_exit(true);
|
||||
|
||||
if (w == fl_digi_main || w->window() == fl_digi_main) {
|
||||
if (fl_digi_main->contains(w)) {
|
||||
if (key == FL_Escape || (key >= FL_F && key <= FL_F_Last) ||
|
||||
((key == '1' || key == '2' || key == '3' || key == '4') && Fl::event_alt())) {
|
||||
TransmitText->take_focus();
|
||||
TransmitText->handle(FL_KEYBOARD);
|
||||
// w->take_focus(); // remove this to leave tx text focused
|
||||
return 1;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
if ((key == '=') && (Fl::event_state() == FL_COMMAND)) {
|
||||
if ((key == '=') && (Fl::event_state() == FL_COMMAND))
|
||||
#else
|
||||
if (key == '=' && Fl::event_alt()) {
|
||||
if (key == '=' && Fl::event_alt())
|
||||
#endif
|
||||
{
|
||||
progdefaults.txlevel += 0.1;
|
||||
if (progdefaults.txlevel > 0) progdefaults.txlevel = 0;
|
||||
cntTxLevel->value(progdefaults.txlevel);
|
||||
return 1;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
if ((key == '-') && (Fl::event_state() == FL_COMMAND)) {
|
||||
if ((key == '-') && (Fl::event_state() == FL_COMMAND))
|
||||
#else
|
||||
if (key == '-' && Fl::event_alt()) {
|
||||
if (key == '-' && Fl::event_alt())
|
||||
#endif
|
||||
{
|
||||
progdefaults.txlevel -= 0.1;
|
||||
if (progdefaults.txlevel < -30) progdefaults.txlevel = -30;
|
||||
cntTxLevel->value(progdefaults.txlevel);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (w == dlgLogbook || w->window() == dlgLogbook)
|
||||
else if (dlgLogbook->contains(w))
|
||||
return log_search_handler(event);
|
||||
|
||||
else if ((Fl::event_key() == FL_Escape) ||
|
||||
|
|
@ -2664,7 +2665,9 @@ int default_handler(int event)
|
|||
TransmitText->visible_focus()))
|
||||
return 1;
|
||||
|
||||
else if (Fl::event_ctrl()) return w->handle(FL_KEYBOARD);
|
||||
else if ( (fl_digi_main->contains(w) || dlgLogbook->contains(w)) &&
|
||||
Fl::event_ctrl() )
|
||||
return w->handle(FL_KEYBOARD);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2685,19 +2688,17 @@ int wo_default_handler(int event)
|
|||
|
||||
if ((key == FL_F + 4) && Fl::event_alt()) clean_exit(true);
|
||||
|
||||
if (w == fl_digi_main || w->window() == fl_digi_main) {
|
||||
if (fl_digi_main->contains(w)) {
|
||||
if (key == FL_Escape || (key >= FL_F && key <= FL_F_Last) ||
|
||||
((key == '1' || key == '2' || key == '3' || key == '4') && Fl::event_alt())) {
|
||||
// TransmitText->take_focus();
|
||||
// TransmitText->handle(FL_KEYBOARD);
|
||||
// w->take_focus(); // remove this to leave tx text focused
|
||||
return 1;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
if ((key == '=') && (Fl::event_state() == FL_COMMAND)) {
|
||||
if ((key == '=') && (Fl::event_state() == FL_COMMAND))
|
||||
#else
|
||||
if (key == '=' && Fl::event_alt()) {
|
||||
if (key == '=' && Fl::event_alt())
|
||||
#endif
|
||||
{
|
||||
progdefaults.txlevel += 0.1;
|
||||
if (progdefaults.txlevel > 0) progdefaults.txlevel = 0;
|
||||
cntTxLevel->value(progdefaults.txlevel);
|
||||
|
|
@ -2714,13 +2715,6 @@ int wo_default_handler(int event)
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
// else if (w == dlgLogbook || w->window() == dlgLogbook)
|
||||
// return log_search_handler(event);
|
||||
|
||||
// else if ((Fl::event_key() == FL_Escape) ||
|
||||
// (Fl::event_ctrl() && ((key == 'z' || key == 'Z')) &&
|
||||
// TransmitText->visible_focus()))
|
||||
// return 1;
|
||||
|
||||
else if (Fl::event_ctrl()) return w->handle(FL_KEYBOARD);
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue