diff options
Diffstat (limited to 'src/Fl_x.cxx')
| -rw-r--r-- | src/Fl_x.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 67971b453..7869791d7 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -356,6 +356,7 @@ static Atom fl_NET_WM_STATE_FULLSCREEN; static Atom fl_NET_WM_FULLSCREEN_MONITORS; static Atom fl_NET_WORKAREA; static Atom fl_NET_WM_ICON; +static Atom fl_NET_ACTIVE_WINDOW; /* X defines 32-bit-entities to have a format value of max. 32, @@ -667,6 +668,7 @@ void fl_open_display(Display* d) { fl_NET_WM_FULLSCREEN_MONITORS = XInternAtom(d, "_NET_WM_FULLSCREEN_MONITORS", 0); fl_NET_WORKAREA = XInternAtom(d, "_NET_WORKAREA", 0); fl_NET_WM_ICON = XInternAtom(d, "_NET_WM_ICON", 0); + fl_NET_ACTIVE_WINDOW = XInternAtom(d, "_NET_ACTIVE_WINDOW", 0); if (sizeof(Atom) < 4) atom_bits = sizeof(Atom) * 8; @@ -2205,6 +2207,20 @@ int Fl_X::ewmh_supported() { return result; } +extern Fl_Window *fl_xfocus; + +void Fl_X::activate_window(Window w) { + if (!ewmh_supported()) + return; + + Fl_X *x = Fl_X::i(fl_xfocus); + if (!x) + return; + + send_wm_event(w, fl_NET_ACTIVE_WINDOW, 1 /* application */, + 0 /* timestamp */, x->xid /* previously active window */); +} + /* Change an existing window to fullscreen */ void Fl_Window::fullscreen_x() { if (Fl_X::ewmh_supported()) { |
