Skip to content

Commit

Permalink
maint: Merge stable to default.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Nov 26, 2024
2 parents c900548 + ac9f011 commit 878649b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
2 changes: 2 additions & 0 deletions libgui/src/qt-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class OCTGUI_API qt_application : public application
bool gui_running () const { return m_gui_running; }
void gui_running (bool arg) { m_gui_running = arg; }

bool multi_threaded () const { return true; }

private:

// If TRUE, the GUI should be started.
Expand Down
4 changes: 2 additions & 2 deletions libinterp/dldfcn/__init_fltk__.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To initialize:
*/

// PKG_ADD: if (__have_feature__ ("FLTK") && __have_feature__ ("OPENGL") && have_window_system () && ! (ismac () && __event_manager_enabled__ ())) register_graphics_toolkit ("fltk"); endif
// PKG_ADD: if (__have_feature__ ("FLTK") && __have_feature__ ("OPENGL") && have_window_system () && ! (ismac () && __is_multi_threaded__ ())) register_graphics_toolkit ("fltk"); endif

#if defined (HAVE_CONFIG_H)
# include "config.h"
Expand Down Expand Up @@ -1312,8 +1312,8 @@ class plot_window : public Fl_Window
graphics_object robj = gh_mgr.get_object (m_fp.get_parent ());

root_figure::properties& rp

= dynamic_cast<root_figure::properties&> (robj.get_properties ());

rp.set_currentfigure (m_fp.get___myhandle__ ().value ());
}
}
Expand Down
21 changes: 21 additions & 0 deletions libinterp/octave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,27 @@ Return true if Octave is running in GUI mode and false otherwise.
%!error <Invalid call> isguirunning (1)
*/

DEFUN (__is_multi_threaded__, args, ,
doc: /* -*- texinfo -*-
@deftypefn {} {@var{tf} =} __is_multi_threaded__ ()
Return true if Octave is running with multiple threads.
@seealso{isguirunning}
@end deftypefn */)
{
if (args.length () != 0)
print_usage ();

// FIXME: This isn't quite right, it just says that we intended to
// start the GUI, not that it is actually running.

return ovl (application::is_multi_threaded ());
}

/*
%!assert (islogical (__is_multi_threaded__ ()))
%!error <Invalid call> __is_multi_threaded__ (1)
*/

DEFUN (argv, args, ,
doc: /* -*- texinfo -*-
@deftypefn {} {@var{args} =} argv ()
Expand Down
8 changes: 8 additions & 0 deletions libinterp/octave.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ class OCTINTERP_API application
virtual bool gui_running () const { return false; }
virtual void gui_running (bool) { }

// TRUE if Octave uses multiple threads (e.g., for interpreter and GUI).
virtual bool multi_threaded () const { return false; }

void program_invocation_name (const std::string& nm)
{ m_program_invocation_name = nm; }

Expand Down Expand Up @@ -332,6 +335,11 @@ class OCTINTERP_API application
return s_instance ? s_instance->gui_running () : false;
}

static bool is_multi_threaded ()
{
return s_instance ? s_instance->multi_threaded () : false;
}

// Convenience functions.

static bool forced_interactive ();
Expand Down

0 comments on commit 878649b

Please sign in to comment.