test not only if header frei0r.h exists, also use an item
[mlt-frei0r-support.git] / shotcut / wm / FrameWindow.cpp
blob7126c425d8751a51f98af38ae6e641179ba88e35
1 // FrameWindow.C
3 // X does not echo back the window-map events (it probably should when
4 // override_redirect is off). Unfortunately this means you have to use
5 // this subclass if you want a "normal" fltk window, it will force a
6 // Frame to be created and destroy it upon hide.
8 // Warning: modal() does not work! Don't turn it on as it screws up the
9 // interface with the window borders. You can use set_non_modal() to
10 // disable the iconize box but the window manager must be written to
11 // not be modal.
13 #include <FL/Fl.H>
14 #include "FrameWindow.h"
15 #include "Frame.h"
17 extern int dont_set_event_mask;
19 void FrameWindow::show() {
20 if (shown()) {Fl_Window::show(); return;}
21 Fl_Window::show();
22 dont_set_event_mask = 1;
23 frame = new Frame(fl_xid(this));
24 dont_set_event_mask = 0;
27 void FrameWindow::hide() {
28 if (shown()) {
29 Fl_Window::hide();
30 delete frame;
34 int FrameWindow::handle(int e) {
35 if (Fl_Window::handle(e)) return 1;
36 // make Esc close the window:
37 if (e == FL_SHORTCUT && Fl::event_key()==FL_Escape) {
38 do_callback();
39 return 1;
41 return 0;