Bug 499064

Summary: Can't drag to resize partitions anymore.
Product: [Applications] partitionmanager Reporter: Rafael Just <RafaelJust>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: RESOLVED FIXED    
Severity: minor    
Priority: NOR    
Version First Reported In: 24.12.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: A video showing me trying to resize a partition by dragging it's edge.

Description Rafael Just 2025-01-23 17:15:34 UTC
Created attachment 177628 [details]
A video showing me trying to resize a partition by dragging it's edge.

SUMMARY
Since a few months or so, I've been unable to drag the edge of a partition (in the resize/move partition window) to resize it. The cursor immediately changes to the move cursor, and when dragged, would always move the partition.
In gparted this is no problem, and a few months ago I could do that in kde partition manager as well.

STEPS TO REPRODUCE
1. Open partitonmanager
2. Enter the resize/move partition window
3. Drag the edge of the partition

OBSERVED RESULT
The partition gets moved.

EXPECTED RESULT
The partition gets resized.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1

ADDITIONAL INFORMATION
This could also be a massive case of Mandela effect  so correct me if that feature never existed.
Comment 1 Andrius Štikonas 2025-01-23 18:48:46 UTC
Hmm, strange. There were no changes in partition manager. Perhaps something changed in Breeze...
Comment 2 Rafael Just 2025-01-23 20:50:58 UTC
Could be, since It only looks like the cursor / partition manager doesn't notice that there is an edge. Could it be perhaps worth to check out the code about defining edges (maybe even border rounding)?
Comment 3 Andrius Štikonas 2025-01-23 20:57:20 UTC
(In reply to Rafael Just from comment #2)
> Could be, since It only looks like the cursor / partition manager doesn't
> notice that there is an edge. Could it be perhaps worth to check out the
> code about defining edges (maybe even border rounding)?

Well, it's mostly here:
https://invent.kde.org/system/kpmcore/-/blob/master/src/gui/partresizerwidget.cpp?ref_type=heads#L117 and https://invent.kde.org/system/kpmcore/-/blob/master/src/gui/partresizerwidget.cpp?ref_type=heads#L108
Comment 4 Rafael Just 2025-01-23 21:11:22 UTC
Could be, since It only looks like the cursor / partition manager doesn't notice that there is an edge. Could it be perhaps worth to check out the code about defining edges (maybe even border rounding)?(In reply to Andrius Štikonas from comment #3)
> (In reply to Rafael Just from comment #2)
> > Could be, since It only looks like the cursor / partition manager doesn't
> > notice that there is an edge. Could it be perhaps worth to check out the
> > code about defining edges (maybe even border rounding)?
> 
> Well, it's mostly here:
> https://invent.kde.org/system/kpmcore/-/blob/master/src/gui/
> partresizerwidget.cpp?ref_type=heads#L117 and
> https://invent.kde.org/system/kpmcore/-/blob/master/src/gui/
> partresizerwidget.cpp?ref_type=heads#L108

Well, my c++ is not very good (I am still a student and just finished learning C) but I'll see what I can do :)
Comment 5 Andrius Štikonas 2025-01-23 21:33:41 UTC
(In reply to Rafael Just from comment #4)
> Could be, since It only looks like the cursor / partition manager doesn't
> notice that there is an edge. Could it be perhaps worth to check out the
> code about defining edges (maybe even border rounding)?(In reply to Andrius
> Štikonas from comment #3)
> > (In reply to Rafael Just from comment #2)
> > > Could be, since It only looks like the cursor / partition manager doesn't
> > > notice that there is an edge. Could it be perhaps worth to check out the
> > > code about defining edges (maybe even border rounding)?
> > 
> > Well, it's mostly here:
> > https://invent.kde.org/system/kpmcore/-/blob/master/src/gui/
> > partresizerwidget.cpp?ref_type=heads#L117 and
> > https://invent.kde.org/system/kpmcore/-/blob/master/src/gui/
> > partresizerwidget.cpp?ref_type=heads#L108
> 
> Well, my c++ is not very good (I am still a student and just finished
> learning C) but I'll see what I can do :)

You probably don't need very good C++ here. This is more of an investigation task. Anyway, I played a bit and found out that
if I add 1 to this line
https://invent.kde.org/system/kpmcore/-/blob/master/src/gui/partresizerwidget.cpp?ref_type=heads#L131
Then resizing mouse cursor reappears.

So my current understanding is that handleWidth is 0. And something changed somewhere else in the stack (Qt or Frameworks) and now zero-width handles don't show that resize cursor.

I'm not 100% sure how to fix that. We could set handleWidth to 1. That would a consequence that we would see a narrow grey rectangle at the boundary of the widget. But maybe that's fine. After all gparted has fairly big widget boundary indicators.
Comment 6 Andrius Štikonas 2025-01-26 20:40:34 UTC
Git commit c2d0444c9f51dadb6bc185047c42acb9b0a84d0f by Andrius Štikonas.
Committed on 26/01/2025 at 20:40.
Pushed by stikonas into branch 'master'.

Add 1 to handleWidth in partresize widget.

This used to be set to 0 and recently, this broke ability to drag-resize partitions.

M  +1    -1    src/gui/partresizerwidget.cpp

https://invent.kde.org/system/kpmcore/-/commit/c2d0444c9f51dadb6bc185047c42acb9b0a84d0f
Comment 7 Andrius Štikonas 2025-01-26 20:41:04 UTC
Git commit 681942bfaf3274f1449c291ca271d16de02b7491 by Andrius Štikonas.
Committed on 26/01/2025 at 20:40.
Pushed by stikonas into branch 'release/24.12'.

Add 1 to handleWidth in partresize widget.

This used to be set to 0 and recently, this broke ability to drag-resize partitions.

M  +1    -1    src/gui/partresizerwidget.cpp

https://invent.kde.org/system/kpmcore/-/commit/681942bfaf3274f1449c291ca271d16de02b7491