#include <kernel/scheduler.h>
#include <private/interface/ToolTip.h>
+#include <private/interface/WindowPrivate.h>
#include <cmath>
#include <cstring>
int shown_flag = 0;
volatile int was_shown_p = 0;
bool menu_bar_active_p = false;
+ window_look pre_override_redirect_style;
+ window_feel pre_override_redirect_feel;
EmacsWindow () : BWindow (BRect (0, 0, 0, 0), "", B_TITLED_WINDOW_LOOK,
B_NORMAL_WINDOW_FEEL, B_NO_SERVER_SIDE_WINDOW_MODIFIERS)
return current_subpixel_antialiasing;
}
+
+/* This isn't implemented very properly (for example: what if
+ decorations are changed while the window is under override
+ redirect?) but it works well enough for most use cases. */
+void
+BWindow_set_override_redirect (void *window, bool override_redirect_p)
+{
+ EmacsWindow *w = (EmacsWindow *) window;
+
+ if (w->LockLooper ())
+ {
+ if (override_redirect_p)
+ {
+ w->pre_override_redirect_feel = w->Feel ();
+ w->pre_override_redirect_style = w->Look ();
+ w->SetFeel (kMenuWindowFeel);
+ w->SetLook (B_NO_BORDER_WINDOW_LOOK);
+ }
+ else
+ {
+ w->SetFeel (w->pre_override_redirect_feel);
+ w->SetLook (w->pre_override_redirect_style);
+ }
+
+ w->UnlockLooper ();
+ }
+}
extern bool
be_use_subpixel_antialiasing (void);
+ extern void
+ BWindow_set_override_redirect (void *window, bool override_redirect_p);
+
#ifdef __cplusplus
extern void *
find_appropriate_view_for_draw (void *vw);
haiku_set_parent_frame (f, parent_frame, Qnil);
gui_default_parameter (f, parms, Qundecorated, Qnil, NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qoverride_redirect, Qnil, NULL, NULL, RES_TYPE_BOOLEAN);
gui_default_parameter (f, parms, Qicon_type, Qnil,
"bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
unblock_input ();
}
+static void
+haiku_set_override_redirect (struct frame *f, Lisp_Object new_value,
+ Lisp_Object old_value)
+{
+ if (EQ (new_value, old_value))
+ return;
+
+ block_input ();
+ BWindow_set_override_redirect (FRAME_HAIKU_WINDOW (f),
+ !NILP (new_value));
+ FRAME_OVERRIDE_REDIRECT (f) = !NILP (new_value);
+ unblock_input ();
+}
+
static void
haiku_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
haiku_set_no_focus_on_map,
haiku_set_no_accept_focus,
NULL, /* set z group */
- NULL, /* set override redir */
+ haiku_set_override_redirect,
gui_set_no_special_glyphs
};