fl_choice() dialog apprearance discrepancy problem in 1.4

瀏覽次數:60 次
跳到第一則未讀訊息

Paul Hahn

未讀,
2021年12月9日 凌晨3:51:572021/12/9
收件者:fltk.general
I use FLTK 1.4 on CentOS 6 linux with g++ 5.1.

At some point after updating FLTK in the last month or so, something happened to what is displayed by my calls to fl_choice().

Scenarios...

A. The call to fl_choice() in test/ask.cxx works fine. For reference, a screenshot of the resulting dialog is attached ("fl_choice-normal.png"):

B. When I make basically the same call to fl_choice() in my app code, then the dialog is quite different, with empty space (see attached "fl_choice-app.png").

The scenario in A is running as root with a bash shell in the terminal. The scenario in B is running as my userid with a tcsh shell in a terminal.

Now for the kicker (i.e., cross-test). If I run my same app executable as root with the bash shell in the same terminal as scenario A, then the fl_choice() dialog actually looks right, as in A. Conversely, if I run test/ask as my userid with the tcsh shell in the same terminal as scenario B, then the fl_choice() dialog actually looks wrong, as in B!

I realize there is plenty for me to think about here in terms of environment as well as my app source code. But in the hope of short-circuiting tons of comparative investigation, and armed with an intuition that this may be related to the shell environment somehow, I just wanted to ask about any insights by FLTK maintainers into possible FLTK causation.

Again, this problem seems to have appeared fairly recently (I update FLTK 1.4 from its git repo nightly), possibly a month back. I observed it back then, but did not report it until now  - sorry.



fl_choice-normal.png
fl_choice-app.png

Ian MacArthur

未讀,
2021年12月9日 凌晨4:46:482021/12/9
收件者:fltk.general
OK - that all sounds a bit strange.

One thing - are you linking fltk into your app as a shared lib, or as a static lib?
That whole "It's different as root" aspect makes me wonder if it's a shared lib thing but the scope, paths or permissions are wrong... 

Also, are you building and linking against a "local" fltk, or is it in a "system" location? Again, that might be pertinent.


Albrecht Schlosser

未讀,
2021年12月9日 清晨7:28:112021/12/9
收件者:fltkg...@googlegroups.com
On 12/9/21 6:27 AM Paul Hahn wrote:
> I use FLTK 1.4 on CentOS 6 linux with g++ 5.1.
>
> At some point after updating FLTK in the last month or so, something
> happened to what is displayed by my calls to fl_choice().

The fl_choice() and other dialogs have been completely rewritten, the
related commit is from five days ago:

commit b6de09cff2465db3c0a6e6a013b825462bc9a0e7
Author: Albrecht Schlosser <albrech...@online.de>
Date:   Sat Dec 4 13:35:47 2021 +0100

    Re-enable nested (aka recursive) common dialogs (STR 3242, #282)
    ...


This can explain that "something changed" but it can't explain the
effects described below.

If you update the FLTK source from Git and if you're using
configure/make I strongly recommend to `make distclean; autoconf;
./configure ...` before you (re)build FLTK. This is because dependencies
used by the Makefile's *may* be incomplete. You should at least use
`make clean; make` to rebuild everything.

I generally recommend to move to CMake which doesn't have these issues.

The other problem that comes to mind is a build where you mixed old and
new header files. If this could be the case, please make sure that you
remove all FLTK headers installed in system locations to be sure you're
building only with the current headers.

But this can still not explain the scenarios below.

>
> Scenarios...
>
> A. The call to fl_choice() in test/ask.cxx works fine. For reference,
> a screenshot of the resulting dialog is attached
> ("fl_choice-normal.png"):
>
> B. When I make basically the same call to fl_choice() in my app code,
> then the dialog is quite different, with empty space (see attached
> "fl_choice-app.png").
>
> The scenario in A is running as root with a bash shell in the
> terminal. The scenario in B is running as my userid with a tcsh shell
> in a terminal.

I agree with Ian that different shared libraries could cause this issue.
Looking forward to your reply on Ian's question.

Paul Hahn

未讀,
2021年12月9日 上午11:33:422021/12/9
收件者:fltk.general
Great questions. [ For this reply, I will only reference test/ask (and not my app code), because it suffices to illustrate the problem. ]

Ian: Yes, I build FLTK as static libs (.a), install those to a local directory, and link with those.

Albrecht: Yes, I always use cmake.

OK, I will tick off the steps I just now took for verification. I did a complete rm -rf * of the contents of my build subdirectory under my fltk-clone (repo) directory. There, I did cmake-gui .. to again configure (e.g., with NO shared libs) and generate.I then did make in that build directory. Looks 100% clean. I then did a rm -rf * in my installation directory, followed by make install back in the build directory, which repopulated the installation directory. Now I go to the test subdirectory under my fltk-clone. I delete ask.o and the ask executable. I then do fltk-config --compile ask.cxx. All good. Attached is a file "ask-ldd.txt" with the ldd output on the ask executable which verifies no FLTK shared libs are being used.

The problem still appears as previously described. When I run the rebuilt ask executable (as root) in its test directory as root, I get the expected display from fl_choice(). However, when I run that same ask executable from my development directory (as me), I get the same problematic display. the attached file "ask-ldd-app.txt" has the output from ldd on the same ask executable done in the latter directory as me.



ask-ldd-app.txt
ask-ldd.txt

Paul Hahn

未讀,
2021年12月9日 上午11:46:562021/12/9
收件者:fltk.general
A significant piece of news. The problem (still not resolved) appears not because I am running as root in a bash shell vs. myself in in a tcsh shell, but because I am running (and all the tests I reported as such while "root") within a VNC session (i.e., TigerVNC).

This all appears to be related to my X server or window manager. In other words, something changed in FLTK "recently" so that the test/ask executable with its fl_choice() displays something flawed when I run it (even as root) in a terminal on my normal display, vs. when I run it from within the VNC session. Wow.

Please note I did not change anything with respect to my X server or window manager (gnome). In fact, I cannot update them because CentOS 6 is "dead" and there have not been any updates for it for a long time. And I did not change any settings.And in case it is of any interest, I have an NVidia GeForce GTX 760 video card but I have not changed the NVidia driver in years.


duncan

未讀,
2021年12月9日 上午11:48:352021/12/9
收件者:fltk.general

[ . . . ]Now I go to the test subdirectory under my fltk-clone. I delete ask.o and the ask executable. I then do fltk-config --compile ask.cxx.

Are you sure that's not picking up a system installed fltk-config by mistake? Is your $PATH set correctly?
To be sure you should use " ../build/bin/fltk-config --compile ask.cxx "  [if you are in the .../fltk-1.4.x/test directory]

This one has bitten me several times.
D.

Greg Ercolano

未讀,
2021年12月9日 上午11:53:492021/12/9
收件者:fltkg...@googlegroups.com
    If we're suspecting that kind of thing, be sure to rename away /usr/include/FL (if it exists) to 'something else',
    so it doesn't get picked up by accident.

Paul Hahn

未讀,
2021年12月9日 上午11:54:542021/12/9
收件者:fltk.general
Good idea. I just now did what you said but no change. But please see my latest post.also about running in VNC vs. desktop.

Paul Hahn

未讀,
2021年12月9日 中午12:07:202021/12/9
收件者:fltk.general
    If we're suspecting that kind of thing, be sure to rename away /usr/include/FL (if it exists) to 'something else',
    so it doesn't get picked up by accident.

OK, another good idea. So now I renamed my system /usr/include/FL -> /usr/include/FL.ORIG. Also, I moved all files /usr/lib64/libfltk* into a temporray directory elsewhere.

Cleaned out my fltk-clone/build and installed areas, completely rebuilt FLTK, then rebuilt ask via ../build/bin/fltk-config --compile ask.cxx. The problem still appears the same as described.

As per my reply about running on VNC vs. desktop, I do believe it has something to do with X server/window manager and something that changed in FLTK.

Albrecht Schlosser

未讀,
2021年12月9日 中午12:09:012021/12/9
收件者:fltkg...@googlegroups.com
On 12/9/21 5:28 PM Paul Hahn wrote:
Great questions. [ For this reply, I will only reference test/ask (and not my app code), because it suffices to illustrate the problem. ]

Ian: Yes, I build FLTK as static libs (.a), install those to a local directory, and link with those.

Albrecht: Yes, I always use cmake.

Good.


OK, I will tick off the steps I just now took for verification. I did a complete rm -rf * of the contents of my build subdirectory under my fltk-clone (repo) directory. There, I did cmake-gui .. to again configure (e.g., with NO shared libs) and generate.I then did make in that build directory. Looks 100% clean. I then did a rm -rf * in my installation directory, followed by make install back in the build directory, which repopulated the installation directory. Now I go to the test subdirectory under my fltk-clone. I delete ask.o and the ask executable. I then do fltk-config --compile ask.cxx. All good. Attached is a file "ask-ldd.txt" with the ldd output on the ask executable which verifies no FLTK shared libs are being used.

As Duncan wrote: please make sure that you pick the correct fltk-config script.

Why do you need to rebuild ask at all, I still don't get what your doing and what you want to achieve.


The problem still appears as previously described. When I run the rebuilt ask executable (as root) in its test directory as root, I get the expected display from fl_choice(). However, when I run that same ask executable from my development directory (as me), I get the same problematic display. the attached file "ask-ldd-app.txt" has the output from ldd on the same ask executable done in the latter directory as me.

I'm seeing differences in the two ldd text files. Seems your build (or your runtime environment) includes different shared libs. Where does this come from? I noticed your post about vnc and non-vnc runs but I don't know how much that can influence the issue. Are you connecting to the system via vnc from another host or are you running it on the same host?

--- ask-ldd.txt    2021-12-09 17:44:24.528492511 +0100
+++ ask-ldd-app.txt    2021-12-09 17:44:24.496492416 +0100
@@ -1,5 +1,5 @@
-[root@athabasca test]# ldd ask
-    linux-vdso.so.1 =>  (0x00007ffecbde8000)
+[pdhahn@athabasca fltkapi]$ ldd /vol1/athabasca/apps/fltk/fltk-clone/test/ask
+    linux-vdso.so.1 =>  (0x00007ffef9551000)

The above diff might not cause any issues but ...

-    libstdc++.so.6 => /vol1/athabasca/apps/usr/local/latest/lib64/libstdc++.so.6 (0x00007f93f4d65000)
-    libgcc_s.so.1 => /vol1/athabasca/apps/usr/local/latest/lib64/libgcc_s.so.1 (0x00007f93f4b4f000)
+    libstdc++.so.6 => /vol1/athabasca/apps/usr/local/gcc-5.1/lib64/libstdc++.so.6 (0x00007fc2c2aeb000)
+    libgcc_s.so.1 => /vol1/athabasca/apps/usr/local/gcc-5.1/lib64/libgcc_s.so.1 (0x00007fc2c28d5000)

This looks suspicious. Two different libgcc and libstdc++ versions?

-    /lib64/ld-linux-x86-64.so.2 (0x00007f93f50f2000)
+    /lib64/ld-linux-x86-64.so.2 (0x00007fc2c2e78000)

Again, probably irrelevant.


OKAY, here's another test. Please check out an older git version to rule out the recent changes to fl_choice():

$ git checkout 7b9ddd97c

Rebuild (just running make in a CMake build dir should suffice) and test again. As others said, remove "other" FLTK dirs and make sure to pick the correct fltk-config script if you build another executable.

It would also be interesting to see if this problem is *only* related to fl_choice() or if there are other issues. Please test a few other FLTK test programs as well.

Paul Hahn

未讀,
2021年12月9日 中午12:30:512021/12/9
收件者:fltk.general
Why do you need to rebuild ask at all, I still don't get what your doing and what you want to achieve.

 Because ask illustrates the problem. For the purposes of describing this problem, I rebuild it explicitly to make sure it's "clean". My original observation of the problem was while running my application, not ask.

I'm seeing differences in the two ldd text files. Seems your build (or your runtime environment) includes different shared libs. Where does this come from? I noticed your post about vnc and non-vnc runs but I don't know how much that can influence the issue. Are you connecting to the system via vnc from another host or are you running it on the same host?

--- ask-ldd.txt    2021-12-09 17:44:24.528492511 +0100
+++ ask-ldd-app.txt    2021-12-09 17:44:24.496492416 +0100
@@ -1,5 +1,5 @@
-[root@athabasca test]# ldd ask
-    linux-vdso.so.1 =>  (0x00007ffecbde8000)
+[pdhahn@athabasca fltkapi]$ ldd /vol1/athabasca/apps/fltk/fltk-clone/test/ask
+    linux-vdso.so.1 =>  (0x00007ffef9551000)

The above diff might not cause any issues but ...

-    libstdc++.so.6 => /vol1/athabasca/apps/usr/local/latest/lib64/libstdc++.so.6 (0x00007f93f4d65000)
-    libgcc_s.so.1 => /vol1/athabasca/apps/usr/local/latest/lib64/libgcc_s.so.1 (0x00007f93f4b4f000)
+    libstdc++.so.6 => /vol1/athabasca/apps/usr/local/gcc-5.1/lib64/libstdc++.so.6 (0x00007fc2c2aeb000)
+    libgcc_s.so.1 => /vol1/athabasca/apps/usr/local/gcc-5.1/lib64/libgcc_s.so.1 (0x00007fc2c28d5000)

This looks suspicious. Two different libgcc and libstdc++ versions?

-    /lib64/ld-linux-x86-64.so.2 (0x00007f93f50f2000)
+    /lib64/ld-linux-x86-64.so.2 (0x00007fc2c2e78000)

Again, probably irrelevant.


Well, the "latest" thing is just a softlink to "gcc-5.1", so that is not a real difference. The others might be, though, especially if they somehow come into play in relation to running on VNC vs. desktop.
 

OKAY, here's another test. Please check out an older git version to rule out the recent changes to fl_choice():

$ git checkout 7b9ddd97c

Rebuild (just running make in a CMake build dir should suffice) and test again. As others said, remove "other" FLTK dirs and make sure to pick the correct fltk-config script if you build another executable.

It would also be interesting to see if this problem is *only* related to fl_choice() or if there are other issues. Please test a few other FLTK test programs as well.


Sounds good.  I will try that right away.

Paul Hahn

未讀,
2021年12月9日 中午12:38:072021/12/9
收件者:fltk.general
 

OKAY, here's another test. Please check out an older git version to rule out the recent changes to fl_choice():

$ git checkout 7b9ddd97c

Rebuild (just running make in a CMake build dir should suffice) and test again. As others said, remove "other" FLTK dirs and make sure to pick the correct fltk-config script if you build another executable.

It would also be interesting to see if this problem is *only* related to fl_choice() or if there are other issues. Please test a few other FLTK test programs as well.


Sounds good.  I will try that right away.

Did the git checkout as directed and did a full clean/rebuild. Yep, that fixed it!

So what in the world happened in FLTK after that???

Albrecht Schlosser

未讀,
2021年12月9日 下午2:04:552021/12/9
收件者:fltkg...@googlegroups.com
You see me stumped.


So what in the world happened in FLTK after that???

As I wrote before, fl_choice() and others have been completely rewritten. But I'm still stumped because this does not explain the effects you see.

IMHO it still (or even more?) looks like an issue with different ABI's, i.e. maybe a mixture of old and new header files or something like that. I have no idea why this would result in such an effect though, but in cases with mixed headers you can't tell what's going on (different ABI).

OK, normally I would now try to `git bisect` the issue. Would you like to assist and do this? If you don't know how to do it you can also use the following commits and test whether the issue exists, in this order:

#1) 240465626 2021-12-04 13:40:29 +0100 Albrecht Schlosser - Add minimal version of class Fl_String
#2) b6de09cff 2021-12-04 14:49:27 +0100 Albrecht Schlosser - Re-enable nested (aka recursive) common dialogs (STR 3242, #282)
#3) 7a7e50df6 2021-12-04 15:34:41 +0100 Albrecht Schlosser - Rename FL/Fl_String.H to FL/Fl_String_class.H
#4) 130f864d1 2021-12-04 15:50:10 +0100 Albrecht Schlosser - Rename src/Fl_String.cxx to src/Fl_String_class.cxx
#5) a0724ab7c 2021-12-04 20:36:11 +0100 Albrecht Schlosser - Add fl_message_icon_label() function (STR #2762)

Just to be sure, I'd mostly be interested in #2, i.e. the one before it (#1), #2 itself, and if this doesn't show the issue, the following commits (#3-#5).

None of these commits should show such issues - unless the ABI change that occurred with #2 and "mixing headers" (or libraries) makes this happen, but I have no idea how this could be.

This is now just wild guessing.

Does anybody else here have "CentOS 6 linux with g++ 5.1" as Paul wrote and could assist in testing?

Paul Hahn

未讀,
2021年12月9日 下午2:11:572021/12/9
收件者:fltk.general
Before doing your git version checkout, I think I ruled out the possibility of mixed FLTK .H headers because I renamed the system install directory of FLTK thus: mv /usr/include/FL -> /usr/include/FL.ORIG. That did not help.

Yes, I will begin the 'git bisect' on my part and see if I can discover the checkin that "caused" the issue for me (if that is what happened). I am pretty sure I am in a minority (maybe, of one) when it comes to the CentOS 6 + gcc 5.1 platform spec.

Thanks!

Ian MacArthur

未讀,
2021年12月9日 下午2:25:592021/12/9
收件者:Fltk General
On 9 Dec 2021, at 19:04, Albrecht wrote:
>
> Does anybody else here have "CentOS 6 linux with g++ 5.1" as Paul wrote and could assist in testing?


No - nor anything all that similar (i.e. RHEL, Fedora...) so I tested on what I had, and everything basically Just Works normally.
Can not reproduce the error.


One thing - question for Paul:

What shell do you build from? Is it the “local” one or the “VNC" one?

I wonder because the different ldd outputs for the two contexts imply, to me at least, they are seeing different runtime environments, so I wonder if there is something in one environment that is not in the other, and that is throwing the build out in some way?


In particular, if the build is done from within the VNC context, and is setting some different env setting, that might go some way to explain why that context then runs OK later, and not the other.

If you see what I mean - I think I explained that poorly...

And - I assume here that you are *not* doing the build when logged in as root, as that would likely be a Bad Thing. Can you confirm you build as a “normal” user?



Paul Hahn

未讀,
2021年12月9日 下午3:18:242021/12/9
收件者:fltk.general
Result of my "git bisect" investigation: the problem shows up for me at version b6de09c "Re-enable nested (aka recursive) common dialogs (STR 3242, #282)" (Albrecht S). The problem does NOT show up at the previous checkin, 2404656.

Ian - Yes, you are right, I am doing a lot of bad things. But frankly, I have been doing them the same way for years (i.e., about 4 or 5 -- no excuse and I will change my ways soon) without this problem. This problem just cropped up at checkin version b6de09c. I will change my ways and see if any of that helps resolve the problem. I hope so and I will advise back on this thread. Make take a little while, though. In the meantime, I am hoping that Albrecht might offer some insights or speculation on what happened in that checkin that may have caused the problem to show up for me. Thanks.


Paul Hahn

未讀,
2021年12月9日 下午3:33:342021/12/9
收件者:fltk.general
#1) 240465626 2021-12-04 13:40:29 +0100 Albrecht Schlosser - Add minimal version of class Fl_String
#2) b6de09cff 2021-12-04 14:49:27 +0100 Albrecht Schlosser - Re-enable nested (aka recursive) common dialogs (STR 3242, #282)
#3) 7a7e50df6 2021-12-04 15:34:41 +0100 Albrecht Schlosser - Rename FL/Fl_String.H to FL/Fl_String_class.H
#4) 130f864d1 2021-12-04 15:50:10 +0100 Albrecht Schlosser - Rename src/Fl_String.cxx to src/Fl_String_class.cxx
#5) a0724ab7c 2021-12-04 20:36:11 +0100 Albrecht Schlosser - Add fl_message_icon_label() function (STR #2762)


You are correct, the problem appears with #2, but not #1.

Paul Hahn

未讀,
2021年12月9日 下午4:42:182021/12/9
收件者:fltk.general

What shell do you build from? Is it the “local” one or the “VNC" one?

I wonder because the different ldd outputs for the two contexts imply, to me at least, they are seeing different runtime environments, so I wonder if there is something in one environment that is not in the other, and that is throwing the build out in some way?


In particular, if the build is done from within the VNC context, and is setting some different env setting, that might go some way to explain why that context then runs OK later, and not the other.

OK just did the cmake/clean/build of FLTK 'master' version in a desktop terminal, not a terminal in VNC. But the problem still shows up the same way -- i.e., bad when the resulting ask is run from the desktop terminal, and OK when run from a terminal within the VNC session. Both terminals have shell = bash, same userid, directory, same envirvars like PATH, etc. Of course, $DISPLAY is different - it's defined in the VNC terminal, but not the desktop terminal (where default is :0).

Please note I am not trying to focus on VNC in particular for this problem; I just observed along the way how odd it is that fl_choice() seems fine when run within a VNC session. I discovered that by accident. Except for the purpose of having a clue into the nature of the problem, I don't really care that it works on VNC, because I do not run my applications through VNC. My focus and concern is why fl_choice() does NOT work in normal circumstances on the desktop, at least starting with FLTK version b6de09cff.

BTW -  as far as the ldd differences I reported previously go, I think the hex values on the RHS for the shared libs refer to linkage addresses (bound dynamically). They change from invocation to invocation of ldd itself with the same program arg. So they are not significant.

Albrecht Schlosser

未讀,
2021年12月9日 下午4:47:432021/12/9
收件者:fltkg...@googlegroups.com
On 12/9/21 9:18 PM Paul Hahn wrote:
Result of my "git bisect" investigation: the problem shows up for me at version b6de09c "Re-enable nested (aka recursive) common dialogs (STR 3242, #282)" (Albrecht S). The problem does NOT show up at the previous checkin, 2404656.

OK, that's what I assumed after your descriptions, but if something is wrong with this change, then this escapes me.

I can do some more tests but - like Ian reported as well - I'm not aware of any issues with this change and we didn't get any other reports yet.


In the meantime, I am hoping that Albrecht might offer some insights or speculation on what happened in that checkin that may have caused the problem to show up for me.

Right now I have absolutely no insights. The internals have been rewritten to be able to use "nested" dialogs. What that means is that internal static objects (mainly the dialog window) have been replaced by class instances of the new internal class Fl_Message. The output (screen rendering) should be absolutely the same, at least for a human observer.

Of course something can go awry in such a big rewrite but then I would have expected that someone says "my program crashes reproducibly" or "the buttons are offset by some pixels" or something like that. Your case is specific in that you say "the same program" works differently if started in a different environment. That looks like the environment is at least one part of the game.

We did not yet rule out VNC, specifically TigerVNC. You also say that you are using root access in one of the cases (IIRC). That alone are 4 different possibilities of an unknown error constellation.

VNC is for me now the most likely cause because it can have to do with different graphics output. From all your statements I can't recall when exactly you see the misbehavior, can you please repeat? Is this when you are connected to the system via TigerVNC? If yes I'd like to see that ruled out. Can you maybe use another VNC client to connect to the same system? What happens if you do that?

And which TigerVNC version are you using? Can you upgrade? Can you connect from another system, maybe with another (Tiger)VNC client?

And, BTW, from what type of system are you connecting to your Linux system? Just in case it matters.

Next question (I still don't get it right): is the misbehavior seen if and only if you are running as root or not as root, or is it directly depending on VNC or non-VNC?

Sorry for these questions, it's all a little unclear to me, after all this back and forth...

I would also suggest that you do the following: build FLTK as a normal user (not root) with test programs (CMake option: FLTK_BUILD_TEST:BOOL=ON). This includes test/ask, obviously, but in your CMake build the executable will reside in [build-dir]/bin/test/ask. Then run exactly this executable - without rebuilding anything - in your two scenarios (VNC and not VNC), preferably with the same /non-root/ user. Is there a difference? If yes, then - I believe - this is very likely TigerVNC's or your VNC server's fault.

Note: if you want to build a particular program with fltk-config from your new build (please don't "install" anything for these tests), you *must* use the fltk-config script in the build directory, for instance:

$ cd $HOME  # use any directory not related to the FLTK build

if your build is in /path/to/fltk/build, then execute explicitly:

/path/to/fltk/build/fltk-config --compile /path/to/fltk/test/ask.cxx

(please post the output here so we can see the compiler options)

Then execute the program that has been built in your $HOME directory:

$ ./ask

Again, you may want to run this identical executable locally or via VNC. You *should* be able to do all this w/o root access, otherwise this could be another unknown detail that might change the outcome.


That all said, I won't be able to reply further tonight, but I'm looking forward to see your replies tomorrow.

Note: please post your TigerVNC version. If I can find the time I can build the latest FLTK version on my Win10 PC and connect from my Linux system with TigerVNC:

$ vncviewer

TigerVNC Viewer 64-bit v1.11.0
Built on: 2021-05-07 12:22
Copyright (C) 1999-2020 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.

I don't know if that is of any help but I might try it (not before tomorrow and only if time permits).

Paul Hahn

未讀,
2021年12月9日 下午4:57:462021/12/9
收件者:fltk.general

That all said, I won't be able to reply further tonight, but I'm looking forward to see your replies tomorrow.


OK sounds good. I will reply later with the information. Thanks, Albrecht.

Paul Hahn

未讀,
2021年12月9日 下午6:42:152021/12/9
收件者:fltk.general
On Thursday, December 9, 2021 at 3:57:46 PM UTC-6 Paul Hahn wrote:

That all said, I won't be able to reply further tonight, but I'm looking forward to see your replies tomorrow.


OK sounds good. I will reply later with the information. Thanks, Albrecht.

Looks like I have a fix that solves my problem.

1. I added a call to window_->init_sizes() at the end of Fl_Message::resizeform() in Fl_Message.cxx.
2. I also modified Fl_Message::innards() to call Fl_Group::current(0) before the call to window_->show().  [ Not sure this one is necessary but it looks to me like it is missing. ]

Here is the git diff on src/Fl_Message.cxx.

> git diff src/Fl_Message.cxx
diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx
index 4332416..cfe4c5c 100644
--- a/src/Fl_Message.cxx
+++ b/src/Fl_Message.cxx
@@ -274,6 +274,7 @@ void Fl_Message::resizeform() {
       button_[i]->resize(x, h - 10 - max_h, button_w[i] - 10, max_h);
     }
   }
+  window_->init_sizes();
 }
 
 /**
@@ -376,6 +377,8 @@ int Fl_Message::innards(const char *fmt, va_list ap, const char *b0, const char
   if (g)
     Fl::grab(0);
   Fl_Group *current_group = Fl_Group::current(); // make sure the dialog does not interfere with any active group
+  if (current_group)
+    Fl_Group::current(0);  

   window_->show();
   Fl_Group::current(current_group);
   while (window_->shown())

Shall I open an issue with this suggested change in github?

Albrecht Schlosser

未讀,
2021年12月9日 晚上9:37:432021/12/9
收件者:fltkg...@googlegroups.com
On 12/10/21 12:42 AM Paul Hahn wrote:

On Thursday, December 9, 2021 at 3:57:46 PM UTC-6 Paul Hahn wrote:

That all said, I won't be able to reply further tonight, but I'm looking forward to see your replies tomorrow.


OK sounds good. I will reply later with the information. Thanks, Albrecht.

Looks like I have a fix that solves my problem.

1. I added a call to window_->init_sizes() at the end of Fl_Message::resizeform() in Fl_Message.cxx.
2. I also modified Fl_Message::innards() to call Fl_Group::current(0) before the call to window_->show().  [ Not sure this one is necessary but it looks to me like it is missing. ]

The good news: both your proposed changes are correct. Great findings!

The bad news: if you compare src/Fl_Message.cxx with an older src/fl_ask.cxx (I used branch-1.3 for comparison) you'll notice that these code sequences have not been changed at all.

That's weird. Although these changes are not wrong they should not have much influence on the overall behavior of the program, particularly not test/fl_ask.cxx. I always like to fix bugs when you have a clear test case that shows a but in the old code and works well with the new code.

Here I must admit that I can't believe that these code changes are the root causes for the behavior you see, particular because this has "always been this way". But there may be a connection, hence I believe we should apply them. However there's still some doubt...

I'll discuss this further below.


Here is the git diff on src/Fl_Message.cxx.

> git diff src/Fl_Message.cxx
diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx
index 4332416..cfe4c5c 100644
--- a/src/Fl_Message.cxx
+++ b/src/Fl_Message.cxx
@@ -274,6 +274,7 @@ void Fl_Message::resizeform() {
       button_[i]->resize(x, h - 10 - max_h, button_w[i] - 10, max_h);
     }
   }
+  window_->init_sizes();
 }

OK, this is correct. Although it's not been in 1.3 and not in the old commit you tested (before this change).

The only explanation I have is that some internal window size changes (aka resize()) that depend on a particular window manager (or VNC?) trigger a resize of the main window that eventually makes the buttons appear in the wrong places. 'window_->init_sizes();' should fix this. It's better to have it than not.

Patch "accepted".


 /**
@@ -376,6 +377,8 @@ int Fl_Message::innards(const char *fmt, va_list ap, const char *b0, const char
   if (g)
     Fl::grab(0);
   Fl_Group *current_group = Fl_Group::current(); // make sure the dialog does not interfere with any active group
+  if (current_group)
+    Fl_Group::current(0);  

   window_->show();
   Fl_Group::current(current_group);
   while (window_->shown())

Same as above, this has not been in the old code (hence it should not trigger a regression) but I agree that it is also correct to add it here. The comment makes clear that this is (was) the intended behavior, particularly because the reset ('Fl_Group::current(current_group);') *is* done after show().

Off the top of my head I can say that ISTR that at least one of the overloaded show() methods always did set Fl_Group::current(0); but I'm not sure.

Anyway, the patch is good. Accepted.
How did you find this?

However I would prefer not to use the line '
if (current_group)' because it's unnecessary and instead just add the line Fl_Group::current(0);

(just in case you send a patch or make a PR, otherwise I can apply it tomorrow).


Shall I open an issue with this suggested change in github?

It's not necessary, I can apply the patch tomorrow. However, if you like to see a commit with your name, then please

(a) open a GitHub PR so I can merge your changes tomorrow

or

(b) commit your changes locally and run

$ git format-patch origin/master..

which will (hopefully) create exactly one file '0001_<your commit message title>.patch if done correctly (whether origin/master is correct depends on the stat of your repo). Then post this patch here or send it to me via mail.

But please remove trailing whitespace (after Fl_Group::current(0);)


Thank you very much for finding this. I'm still surprised that this fixes the issue for you but it's IMHO really good to apply your patch. I must admit that I didn't look at the code in the first place given your description of the issue.

Paul Hahn

未讀,
2021年12月9日 晚上10:24:202021/12/9
收件者:fltk.general
On Thursday, December 9, 2021 at 8:37:43 PM UTC-6 Albrecht Schlosser wrote:
On 12/10/21 12:42 AM Paul Hahn wrote:

On Thursday, December 9, 2021 at 3:57:46 PM UTC-6 Paul Hahn wrote:

That all said, I won't be able to reply further tonight, but I'm looking forward to see your replies tomorrow.


OK sounds good. I will reply later with the information. Thanks, Albrecht.

Looks like I have a fix that solves my problem.

1. I added a call to window_->init_sizes() at the end of Fl_Message::resizeform() in Fl_Message.cxx.
2. I also modified Fl_Message::innards() to call Fl_Group::current(0) before the call to window_->show().  [ Not sure this one is necessary but it looks to me like it is missing. ]

The good news: both your proposed changes are correct. Great findings!

The bad news: if you compare src/Fl_Message.cxx with an older src/fl_ask.cxx (I used branch-1.3 for comparison) you'll notice that these code sequences have not been changed at all.

That's weird. Although these changes are not wrong they should not have much influence on the overall behavior of the program, particularly not test/fl_ask.cxx. I always like to fix bugs when you have a clear test case that shows a but in the old code and works well with the new code.

Here I must admit that I can't believe that these code changes are the root causes for the behavior you see, particular because this has "always been this way". But there may be a connection, hence I believe we should apply them. However there's still some doubt...

I'll discuss this further below.


Here is the git diff on src/Fl_Message.cxx.

> git diff src/Fl_Message.cxx
diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx
index 4332416..cfe4c5c 100644
--- a/src/Fl_Message.cxx
+++ b/src/Fl_Message.cxx
@@ -274,6 +274,7 @@ void Fl_Message::resizeform() {
       button_[i]->resize(x, h - 10 - max_h, button_w[i] - 10, max_h);
     }
   }
+  window_->init_sizes();
 }

OK, this is correct. Although it's not been in 1.3 and not in the old commit you tested (before this change).

The only explanation I have is that some internal window size changes (aka resize()) that depend on a particular window manager (or VNC?) trigger a resize of the main window that eventually makes the buttons appear in the wrong places. 'window_->init_sizes();' should fix this. It's better to have it than not.

I think your speculation on causality is on the right track. The effect was real. Yes, you never know about this kind of thing -- it may have eventually shown up as a mystery for someone else down the road, under the right circumstances, not only now for me on my old CentOS 6 + gcc 5.1 platform.


Patch "accepted".


 /**
@@ -376,6 +377,8 @@ int Fl_Message::innards(const char *fmt, va_list ap, const char *b0, const char
   if (g)
     Fl::grab(0);
   Fl_Group *current_group = Fl_Group::current(); // make sure the dialog does not interfere with any active group
+  if (current_group)
+    Fl_Group::current(0);  

   window_->show();
   Fl_Group::current(current_group);
   while (window_->shown())

Same as above, this has not been in the old code (hence it should not trigger a regression) but I agree that it is also correct to add it here. The comment makes clear that this is (was) the intended behavior, particularly because the reset ('Fl_Group::current(current_group);') *is* done after show().

Off the top of my head I can say that ISTR that at least one of the overloaded show() methods always did set Fl_Group::current(0); but I'm not sure.

Anyway, the patch is good. Accepted.
How did you find this?

Well, I just decided to review the relevant source code before a lot more back-and-forth on this forum wasted your time, especially since you do not have access to my specific platform. I came armed with my own experiences in the last year or so of developing my own "composite" widgets, where I had been burned by not having the call to init_sizes() after doing resizes of child widgets in groups. That is the only reason why I caught it.


However I would prefer not to use the line '
if (current_group)' because it's unnecessary and instead just add the line Fl_Group::current(0);

(just in case you send a patch or make a PR, otherwise I can apply it tomorrow).

Shall I open an issue with this suggested change in github?

It's not necessary, I can apply the patch tomorrow. However, if you like to see a commit with your name, then please

No, I do not need to have my name on the commit, so please just do the changes on your side.


Thank you very much for finding this. I'm still surprised that this fixes the issue for you but it's IMHO really good to apply your patch. I must admit that I didn't look at the code in the first place given your description of the issue.

You're welcome. Might I also add tongue-in-cheek, that maybe CentOS 6 w/ gcc 5.1 should become a reference test-bed for FLTK, since as Ian reported, he could not see the problem on the more modern linux platforms at his disposal. Not that this particular platform is used by anyone other than me, but it could serve as a good "sieve". :-)

Ian MacArthur

未讀,
2021年12月10日 凌晨3:17:552021/12/10
收件者:fltk.general
So... this all seems a bit odd, now I think of it.
When I first read Paul's report, my reaction was that it was some form of window manager interaction issue, and that the two cases "local" and "vnc" were exhibiting differing behaviours due to different WM.

But... I was thinking of VNC doing the remote in "the same" or similar fashion as X, but that's not really what VNC does, is it? I don't use it on X (since X can remote anyway) only on WinXX and MacOS, and there it seems to mainly just be passing the screen image, not serving the windows remotely...

In which case, the WM would be the same?? 
I don't know how VNC operates on X though, and Paul did say the display was set differently in each case, so perhaps it does, in effect, remote to a different WM in that case?

But still... odd...
 

Paul Hahn

未讀,
2021年12月10日 上午10:53:352021/12/10
收件者:fltk.general
Not trying to beat a dead horse, but Albrecht had earlier asked for my VNC version; so FWIW:

TigerVNC Viewer for X version 1.1.0 - built Mar 22 2017 18:05:28
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.

Again, the noteworthy and strange thing was that fl_choice() WORKED within the VNC viewer, but NOT the desktop. The above-discussed fixes rectified that, so now it works fine on the desktop also. BTW I have no real interest in running within VNC per se, I just happened to try it during the investigation. My apps run on the desktop! I emphasize this so you don't waste your time walking too far down the VNC rabbit trail, at least for my sake. :-)

Albrecht Schlosser

未讀,
2021年12月10日 下午1:27:122021/12/10
收件者:fltkg...@googlegroups.com
On 12/10/21 4:24 AM Paul Hahn wrote:

On Thursday, December 9, 2021 at 8:37:43 PM UTC-6 Albrecht Schlosser wrote:

The only explanation I have is that some internal window size changes (aka resize()) that depend on a particular window manager (or VNC?) trigger a resize of the main window that eventually makes the buttons appear in the wrong places. 'window_->init_sizes();' should fix this. It's better to have it than not.

I think your speculation on causality is on the right track. The effect was real. Yes, you never know about this kind of thing -- it may have eventually shown up as a mystery for someone else down the road, under the right circumstances, not only now for me on my old CentOS 6 + gcc 5.1 platform.

I've seen some strange resizing sequences on application startup when working on another topic (an STR about "tiny windows"). You may find a commit with reference to this STR. The sequences I saw included resizing the window to width/height (1, 1) before it was resized to its final size. This made me think of a similar "feature" of the WM you are using.

But let's finish this now, the problem is solved. And I learned that you can never know what a WM does with your windows. ;-)


It's not necessary, I can apply the patch tomorrow. However, if you like to see a commit with your name, then please

No, I do not need to have my name on the commit, so please just do the changes on your side.

Done. Commit a8cc34032.


Might I also add tongue-in-cheek, that maybe CentOS 6 w/ gcc 5.1 should become a reference test-bed for FLTK, since as Ian reported, he could not see the problem on the more modern linux platforms at his disposal. Not that this particular platform is used by anyone other than me, but it could serve as a good "sieve". :-)

Might I also add tongue-in-cheek, that you are friendly invited to do these checks for the FLTK community?  ;-)

Seriously: your findings are very much appreciated and every system we can test FLTK on is an advantage. Unfortunately we don't have a build and test farm (except what GitHub Actions and GitLab CI provide). Your issue would hardly have been found by testing unless by accident. It's clear that nobody can test all applications on all platforms. Unit tests that include graphic output would be fine but hard to achieve, impossible for our team. All the different configure/CMake options multiply to a giant set of different configurations, notwithstanding all the different platforms.

That said, I started a while ago using docker containers for build tests. I could for instance install a Sci Linux 7 (not sure about the exact version) docker instance for a problem Greg was facing and I could replicate and solve it. That's cool!

I may also look for a CentOS 6 docker container if time permits which is currently very unlikely. That would also be a nice enhancement. But these containers don't use their own WM's, they use the display of the host system - hence I wouldn't have been able to find your issue because it was very likely caused by WM interactions.

The only way out of this dilemma (is it?) is to install a VM with that particular OS and to use the Window Manager in question. Which leads me to the hopefully last three questions in this thread, just in case I can find an old distro image (see below) which I can install in a VM: which WM did you use, and do you have a link to (official) CentOS 6 installation images (see also below)?

FTR: Docker images of CentOS (CentOS 6 to 8): https://registry.hub.docker.com/_/centos/

ISO images for CentOS 6.6: https://vault.centos.org/6.6/isos/x86_64/ (picked an arbitrary version 6.6)

There are also other 6.x versions, so here is the third and last question: which Centos 6 version are you using? The range is from 6.0 to 6.10.

Paul Hahn

未讀,
2021年12月10日 下午3:55:392021/12/10
收件者:fltk.general
On Friday, December 10, 2021 at 12:27:12 PM UTC-6 Albrecht Schlosser wrote:
On 12/10/21 4:24 AM Paul Hahn wrote:

On Thursday, December 9, 2021 at 8:37:43 PM UTC-6 Albrecht Schlosser wrote:

The only explanation I have is that some internal window size changes (aka resize()) that depend on a particular window manager (or VNC?) trigger a resize of the main window that eventually makes the buttons appear in the wrong places. 'window_->init_sizes();' should fix this. It's better to have it than not.

I think your speculation on causality is on the right track. The effect was real. Yes, you never know about this kind of thing -- it may have eventually shown up as a mystery for someone else down the road, under the right circumstances, not only now for me on my old CentOS 6 + gcc 5.1 platform.

I've seen some strange resizing sequences on application startup when working on another topic (an STR about "tiny windows"). You may find a commit with reference to this STR. The sequences I saw included resizing the window to width/height (1, 1) before it was resized to its final size. This made me think of a similar "feature" of the WM you are using.

But let's finish this now, the problem is solved. And I learned that you can never know what a WM does with your windows. ;-)


It's not necessary, I can apply the patch tomorrow. However, if you like to see a commit with your name, then please

No, I do not need to have my name on the commit, so please just do the changes on your side.

Done. Commit a8cc34032.


Might I also add tongue-in-cheek, that maybe CentOS 6 w/ gcc 5.1 should become a reference test-bed for FLTK, since as Ian reported, he could not see the problem on the more modern linux platforms at his disposal. Not that this particular platform is used by anyone other than me, but it could serve as a good "sieve". :-)

Might I also add tongue-in-cheek, that you are friendly invited to do these checks for the FLTK community?  ;-)

I will try to accommodate and allocate more time to running FLTK tests more frequently / consistently. Right now, I primarily just see effects when they show up in tests of my GUI-based apps. Not all apps I develop are GUI-based -- I am mostly focused on algorithms and data crunching in my work, but I have also done my share of FLTK custom widget-writing over the last several years for my GUIs...i.e., adding the slow+heavy part to the fast+light part.


Seriously: your findings are very much appreciated and every system we can test FLTK on is an advantage. Unfortunately we don't have a build and test farm (except what GitHub Actions and GitLab CI provide). Your issue would hardly have been found by testing unless by accident. It's clear that nobody can test all applications on all platforms. Unit tests that include graphic output would be fine but hard to achieve, impossible for our team. All the different configure/CMake options multiply to a giant set of different configurations, notwithstanding all the different platforms.

That said, I started a while ago using docker containers for build tests. I could for instance install a Sci Linux 7 (not sure about the exact version) docker instance for a problem Greg was facing and I could replicate and solve it. That's cool!

I may also look for a CentOS 6 docker container if time permits which is currently very unlikely. That would also be a nice enhancement. But these containers don't use their own WM's, they use the display of the host system - hence I wouldn't have been able to find your issue because it was very likely caused by WM interactions.

The only way out of this dilemma (is it?) is to install a VM with that particular OS and to use the Window Manager in question. Which leads me to the hopefully last three questions in this thread, just in case I can find an old distro image (see below) which I can install in a VM: which WM did you use, and do you have a link to (official) CentOS 6 installation images (see also below)?

FTR: Docker images of CentOS (CentOS 6 to 8): https://registry.hub.docker.com/_/centos/

ISO images for CentOS 6.6: https://vault.centos.org/6.6/isos/x86_64/ (picked an arbitrary version 6.6)

There are also other 6.x versions, so here is the third and last question: which Centos 6 version are you using? The range is from 6.0 to 6.10.


I use CentOS 6.10 with (I think) all the latest updates provided before 6 went EOL (and before the original CentOS Project was destroyed by RH).

> uname -a
Linux hostname 2.6.32-754.35.1.el6.centos.plus.x86_64 #1 SMP Sat Nov 7 11:33:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Here is what I used to install on another machine recently:
My window manager is gnome; gnome-about reports:

Version: 2.28.2
Distributor: CentOS Project
Build Date: 101/10/2012

Albrecht Schlosser

未讀,
2021年12月10日 下午5:00:382021/12/10
收件者:fltkg...@googlegroups.com
OK, thank you. With this information (particularly that of updating the repo URL's) I'll find my way when (if!) I can find the time to install yet another VM. But I'm curious how this may work out, hence it's possible that I'll do it (soon'ish).

Thanks for all your support.

Paul Hahn

未讀,
2021年12月10日 下午5:55:272021/12/10
收件者:fltk.general
On Friday, December 10, 2021 at 4:00:38 PM UTC-6 Albrecht Schlosser wrote:
On 12/10/21 9:55 PM Paul Hahn wrote:
OK, thank you. With this information (particularly that of updating the repo URL's) I'll find my way when (if!) I can find the time to install yet another VM. But I'm curious how this may work out, hence it's possible that I'll do it (soon'ish).

 
BTW, in case you get the CentOS 6.10 platform installed,  just thought I'd add that my desktop X11 server is configured for 2 physical displays as one virtual display ("xinerama"?). And these are the X libs linked in when I compile ask.cxx using fltk-config: -lX11 -lXext -lXinerama -lXfixes -lXcursor -lXft -lXrender
 
Many thanks to you and the entire FLTK maintainer team for keeping FLTK alive and healthy!



回覆所有人
回覆作者
轉寄
0 則新訊息