octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45943] commands shg and figure(N) (where figu


From: Tasos Papastylianou
Subject: [Octave-bug-tracker] [bug #45943] commands shg and figure(N) (where figure N exists) fail to bring figure window to foreground
Date: Wed, 02 Dec 2015 12:25:15 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #10, bug #45943 (project octave):

Apologies for re-posting. The verbatim section got eaten up on the website.
Second attempt: 

Suggested OS-dependent workaround for shg (and figure).

 

% in file shg.m
function shg ()

  if (nargin != 0)
    warning ("shg: ignoring extra arguments");
  endif

  [status, output] = system ('which xdotool');
  if status
    warning ('You don''t seem to have ''xdotool'' installed on your system.
Please install it via your distribution''s package manager in order to raise
figure windows effectively');
  else
    tmpName = tempname;
    oldName = get (gcf, 'name');
    set (gcf, 'name', tmpName);
    if system (['xdotool search --name ' tmpName ' windowraise']);
      warning ('Could not raise figure window');
    end
    set(gcf,'name',oldName);
  end
 
endfunction

 

shg could then also be appended at the end of the 'figure' command definition
to ensure appropriately raising the window whenever an existing figure is
called.

Disadvantages:
1) millisecond flash of the temporary title name before switching back to the
old one.
2) Only works on linux (possibly mac?). If someone knows of a similar tool on
windows then this is a decent workaround until a proper Qt/C++ fix takes
place.

Note: 'windowraise', as opposed to 'windowactivate', maintains the focus on
whatever window was active prior to issuing the command. This is the intended
behaviour since shg is usually a terminal-issued command, typed to raise the
window but the user then continues typing in the terminal. 'windowactivate'
would lose the focus from the console and the user would have to pick up the
mouse and click back on the console again (which makes typing shg redundant
in
this context).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45943>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]