From: Po Lu Date: Sat, 7 May 2022 06:17:46 +0000 (+0000) Subject: Implement `sticky' frame parameter on Haiku X-Git-Tag: emacs-29.0.90~1931^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a775528d17ce4cb070c36af1023a2dfecad24569;p=emacs.git Implement `sticky' frame parameter on Haiku * src/haiku_support.cc (BWindow_set_sticky): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_set_sticky, haiku_frame_parm_handlers): New frame param handler. --- diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 300a78cd73b..105da3969ff 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -5067,3 +5067,18 @@ be_select_font (void (*process_pending_signals_function) (void), return true; } + +void +BWindow_set_sticky (void *window, bool sticky) +{ + BWindow *w = (BWindow *) window; + + if (w->LockLooper ()) + { + w->SetFlags (sticky ? (w->Flags () + | B_SAME_POSITION_IN_ALL_WORKSPACES) + : w->Flags () & ~B_SAME_POSITION_IN_ALL_WORKSPACES); + + w->UnlockLooper (); + } +} diff --git a/src/haiku_support.h b/src/haiku_support.h index 1433783c9fb..5ded9300d8a 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -504,6 +504,7 @@ extern bool BWindow_is_active (void *); extern void BWindow_set_override_redirect (void *, bool); extern void BWindow_dimensions (void *, int *, int *); extern void BWindow_set_z_group (void *, enum haiku_z_group); +extern void BWindow_set_sticky (void *, bool); extern void BWindow_Flush (void *); extern void BFont_close (void *); diff --git a/src/haikufns.c b/src/haikufns.c index 2f26623fa5c..8596317de25 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -1783,6 +1783,15 @@ haiku_set_inhibit_double_buffering (struct frame *f, unblock_input (); } +static void +haiku_set_sticky (struct frame *f, Lisp_Object new_value, + Lisp_Object old_value) +{ + block_input (); + BWindow_set_sticky (FRAME_HAIKU_WINDOW (f), !NILP (new_value)); + unblock_input (); +} + DEFUN ("haiku-set-mouse-absolute-pixel-position", @@ -2713,7 +2722,7 @@ frame_parm_handler haiku_frame_parm_handlers[] = gui_set_fullscreen, gui_set_font_backend, gui_set_alpha, - NULL, /* set sticky */ + haiku_set_sticky, NULL, /* set tool bar pos */ haiku_set_inhibit_double_buffering, haiku_set_undecorated,