mirror of
https://github.com/0ldsk00l/nestopia.git
synced 2024-06-02 19:38:20 -04:00
FLTK: Handle some bugs exhibited when using GNOME
This commit is contained in:
parent
0ad4790576
commit
fcb3976aaf
|
@ -437,12 +437,17 @@ int handle(int e) {
|
|||
|
||||
int NstWindow::handle(int e) {
|
||||
switch (e) {
|
||||
case FL_KEYDOWN: case FL_KEYUP:
|
||||
inputmgr->event(Fl::event_key(), e == FL_KEYDOWN);
|
||||
case FL_KEYDOWN: case FL_KEYUP: {
|
||||
// GNOME has a bad habit of spamming keyup events while holding
|
||||
// a button down, so Fl::get_key is required here.
|
||||
int key = Fl::event_key();
|
||||
bool down = Fl::get_key(key);
|
||||
inputmgr->event(key, down);
|
||||
if (jgm->is_loaded()) {
|
||||
inputmgr->ui_events();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Fl_Double_Window::handle(e);
|
||||
}
|
||||
|
@ -550,6 +555,7 @@ void makenstwin(const char *name) {
|
|||
nstwin = new NstWindow(rw, rh + UI_MBARHEIGHT, name);
|
||||
nstwin->color(FL_BLACK);
|
||||
nstwin->xclass("nestopia");
|
||||
nstwin->resizable(nstwin);
|
||||
|
||||
nstwin->begin();
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ private:
|
|||
|
||||
public:
|
||||
NstWindow(int w, int h, const char* t = 0) : Fl_Double_Window(w, h, t) { }
|
||||
virtual ~NstWindow() { }
|
||||
|
||||
void resize(int x, int y, int w, int h);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue