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

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

[Octave-bug-tracker] [bug #56110] Setting figure position is ignored whe


From: Pantxo Diribarne
Subject: [Octave-bug-tracker] [bug #56110] Setting figure position is ignored when set before the figure is drawn
Date: Thu, 11 Apr 2019 15:08:10 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

Follow-up Comment #15, bug #56110 (project octave):

>> Maybe the problem is more that figure() returns control to the interpreter
too quickly (on some computers) while the GUI thread is still active preparing
the figure.
This should not happen since we enforce synchronous execution using a
Qt::BlockingQueuedConnection. For testing, the following diff (also attached
as sync_test.diff) should always print: "step 1, 2, 3" after a figure is
created 


diff -r 34267e66915a libgui/graphics/Backend.cc
--- a/libgui/graphics/Backend.cc        Fri Nov 16 17:57:00 2018 +0100
+++ b/libgui/graphics/Backend.cc        Thu Apr 11 20:57:34 2019 +0200
@@ -111,8 +111,14 @@
         OCTAVE_PTR_TYPE tmp (reinterpret_cast<OCTAVE_INTPTR_TYPE> (proxy));
         gObj.get_properties ().set (toolkitObjectProperty (go), tmp);
 
+        if (go.isa ("figure"))
+          printf ("step 1, ");
+        
         emit createObject (go.get_handle ().value ());
 
+        if (go.isa ("figure"))
+          printf ("3\n");
+        
         return true;
       }
 
diff -r 34267e66915a libgui/graphics/Figure.cc
--- a/libgui/graphics/Figure.cc Fri Nov 16 17:57:00 2018 +0100
+++ b/libgui/graphics/Figure.cc Thu Apr 11 20:57:34 2019 +0200
@@ -149,6 +149,8 @@
 
     win->addReceiver (this);
     m_container->addReceiver (this);
+    
+    printf ("2, ");
   }
 
   Figure::~Figure (void)




>> This would be consistent with the fact that pasting the code in to an
Octave window works
No, I think that executing the code in the command window is equivalent to
calling "gh_manager::process_events" after each line of code.

>> Could someone who can reproduce this try the following code which uses a
pause() statement after figure creation to let the graphics system settle
out.
Yes, this works since pause is equivalent to "gh_manager::process_events" and
thus equivalent to the diff in comment #12

(file #46752)
    _______________________________________________________

Additional Item Attachment:

File name: sync_test.diff                 Size:1 KB
    <https://savannah.gnu.org/file/sync_test.diff?file_id=46752>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56110>

_______________________________________________
  Message posté via Savannah
  https://savannah.gnu.org/




reply via email to

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