Hang on spreadsheet cell copy?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Hang on spreadsheet cell copy?

Post by aapo »

chennes wrote: Mon Nov 21, 2022 8:47 pm Well, I'm both sorry you're having the problem, and glad it's not just my imagination! I wasn't paying attention to the timing on my system upgrade, but I am running that cumulative update on all the systems I work on.
I had a similar problem with completely unrelated Qt program I had written for Windows, where copy-paste ceased to work after a recent cumulative update. The problem was that I had overrided the Qt function virtual void keyPressEvent(QKeyEvent *event) in QTableWidget in a silly, incompatible way, but somehow it did work in an earlier Windows. I'm not sure if my current code is correct, either, but now it works (copy() and paste() are the actual routines that handle certain user-defined areas of the table data, nothing exciting there). For some reason, in my computer after the Windows update, the event must be passed to parent class when pasting, and it must not be passed to the parent class when copying; otherwise copy-paste does not work for me. And this happens only after the Windows update is installed. It's weird, probably Qt-related, and your mileage may vary.

Code: Select all

void MyQTableWidget::keyPressEvent(QKeyEvent * event)
{
    if (event->matches(QKeySequence::Copy)) {
        copy();
        return;
    } else if(event->matches(QKeySequence::Paste)) {
        paste();
    }

    /* Do some unrelated automated focus-moving stuff here */
	
    QTableWidget::keyPressEvent(event);

    return;
}
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Hang on spreadsheet cell copy?

Post by aapo »

aapo wrote: Tue Nov 22, 2022 12:56 pm The problem was that I had overrided the Qt function virtual void keyPressEvent(QKeyEvent *event) in QTableWidget
There is a somewhat similar special event handling override mechanism in bool event(QEvent *event) override; that is only used by spreadsheets in src/Mod/Spreadsheet/Gui/SheetTableView.h and src/Mod/Spreadsheet/Gui/SheetTableView.cpp. I think it'd be my 1st place to look at, in case that the event handling there might be somehow incompatible with this recent Windows Update. However, it's clearly not the exact same problem I experienced, but it could be something similar with the little bit oddball event handling there.
Dr_Romeo_Chair
Posts: 4
Joined: Fri Jul 15, 2016 4:46 am

Re: Hang on spreadsheet cell copy?

Post by Dr_Romeo_Chair »

I'm seeing something similar. After I did a cut-paste, the spreadsheet hangs for 30-60 seconds even when you simply left click on a cell

Oh.. one weird thing after I pasted the info from FreeCad help->about .. I'm actually running on Windows 11 but FreeCAD is reporting Windows 10.

Info from Windows->System Information

Code: Select all

OS Name	Microsoft Windows 11 Pro
Version	10.0.22621 Build 22621
Here's the info from FreeCad->Help->About

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * 3D_Printing_Tools
  * A2plus 0.4.54b
  * Assembly4 0.12.4
  * boltsfc 2022.11.5
  * CADExchanger
  * Curves 0.6.1
  * ExtremeProLight 1.3.3
  * fasteners 0.4.23
  * freecad.gears 1.0.0
  * lattice2 1.0.0
  * Lithophane
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Hang on spreadsheet cell copy?

Post by GeneFC »

Dr_Romeo_Chair wrote: Tue Nov 22, 2022 7:53 pm I'm actually running on Windows 11 but FreeCAD is reporting Windows 10.
I believe Windows 11 is little more than an extensive redo of the user interface to be more like the so-called Universal Windows Platform used in other MS products. The core is still Windows 10.

If you ask the Windows installation to identify itself (as FreeCAD does) it responds "Windows 10".

Gene
Dr_Romeo_Chair
Posts: 4
Joined: Fri Jul 15, 2016 4:46 am

Re: Hang on spreadsheet cell copy?

Post by Dr_Romeo_Chair »

Just reporting the details I have available.. I also doubt that it makes any difference, but erring on the side of too much info.
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: Hang on spreadsheet cell copy?

Post by PAS_Drafter »

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)

I got a new computer last week and installed the latest version of FreeCAD on it. For the most part it seemed to be working fine. However, as I was working on a project with spreadsheets, I noticed that it was doing exaclty what is described in this post. When I would select either a single cell or multiple cells, and then try to copy those cell(s), FreeCAD would hang for 30 seconds and the fan on my computer would kick in like it was using a lot of processing power. During this time, I could do nothing in FreeCAD. Eventually it would come back to normal, and I could continue working again.

If I just select text from within a cell and copy, the program works properly. The problem only happens when I try to copy a cell or cells.

It will also do the same thing the first time I Paste what is in the green copy box although, the delay to come back to working is not as long. Additionally, if I continue to Paste the cell after that, there is no delay.

The problem was so annoying, I uninstalled all the FreeCAD versions on my computer and installed an older version that worked properly on my other computer. However, after installing that version, my new computer still had the same problem. I have confirmed that the same version of software on two different computers is acting differently.

The only difference I can see is that on the working computer I am running Windows 10. My new computer came with Windows 11 Pro. I am assuming the problem has to be with the Windows 11.

I thought the problem might be related to this issue https://github.com/FreeCAD/FreeCAD/issues/8061 but I have attempted using the version they provided there and I have the same problem. Also, I am not seeing a delay when Spreadsheet starts, only when I hit Copy and Paste.

Anyway, I just wanted to add on that there are others running into this problem. It basically makes using Spreadsheet WB impossible.
Dr_Romeo_Chair wrote: Tue Nov 22, 2022 7:53 pm Oh.. one weird thing after I pasted the info from FreeCad help->about .. I'm actually running on Windows 11 but FreeCAD is reporting Windows 10
I noticed that too and brought that up in the linked post. The programmers are aware of that. Apparently, it is a Windows thing where they have changed something and FreeCAD can no longer detect if it is Windows 11 or not.
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: Hang on spreadsheet cell copy?

Post by PAS_Drafter »

I think this is a different issue than what has been discussed in the bugfix discussions (https://github.com/FreeCAD/FreeCAD/issues/8061). The symptoms are the same (FreeCAD stalls out for 20 to 30 seconds), but the cause is different (entering Spreadsheet WB vs. Coping cells in Spreadsheet WB). It looks like the stalling when entering Spreadsheet WB has been resolved; however, the problem with the Coping cells has not.

Since they appear to be different and the second one has not been resolved, I have created a new bug ticket that describes this alternative problem at: https://github.com/FreeCAD/FreeCAD/issues/8265 so the other one can be closed and people can try to come up with a solution for this other issue.
premudriy
Posts: 2
Joined: Thu Jan 26, 2023 9:13 pm

Re: Hang on spreadsheet cell copy?

Post by premudriy »

I'm just confirming this issue on Windows 11 as well. I use Realthunder's branch, but it happens there as well. It only hangs for me when I copy/cut/paste cells (doesn't hang when opening the sheet, entering cells, or anywhere else). The hang is about 15 seconds long for me.

About info (I am on the latest Windows 11, despite the info below stating Windows 10):

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 2023.114.26244 +5346 (Git)
Build type: Release
Branch: LinkDaily
Hash: 734bfcf15661aea45b019c0588e70e33c33ee73c
Python version: 3.8.10
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.6.2
Locale: English/United States (en_US)
acpopescu
Posts: 16
Joined: Thu Jan 19, 2023 11:49 pm
Contact:

Re: Hang on spreadsheet cell copy?

Post by acpopescu »

The issue is Windows Accesibility hitting all cells in the table, even if they are empty.

The correct solution would be to implement an accessibility interface for the

Code: Select all

SpreadsheetGui::SheetTableView
.

The other way (blech) is to disable accessibility features on the spreadsheet if you are blocked by this https://github.com/FreeCAD/FreeCAD/issu ... 1412797156

I'm not sure we want a PR to disable accessibility on the SheetTableView.
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: Hang on spreadsheet cell copy?

Post by PAS_Drafter »

@acpopescu had done a lot of troubleshooting on this issue during this last week and had narrowed it down to something in the Windows Accessibility. Because of that, I started snooping around the Accessibility settings on the Windows side.

I found a setting in the page for the System ---> Clipboard section that seems to cause the problem.

ClipboardSettings.png
ClipboardSettings.png (64.49 KiB) Viewed 587 times

If you turn "Suggested actions" off, the problem goes away. You turn it back on, the problem comes back (you don't even have to close FreeCAD between the switches). So if you are running into this problem a temporary work around would be to turn that option off until the FreeCAD development team can come up with a programming solution to take that into account.

After looking at what @acpopescu found and what this link does, I suspect that Windows is trying to copy the entire spreadsheet and send that data back to their server to get suggestions on what to do with the data. Gee Microsoft, thanks for the "help" :roll:

If anyone else is having this problem, you can see if this works on your system and let us know.
Post Reply