Skip to content

fix(desktop): prevent horizontal scrolling by constraining window drag (#710)#1443

Merged
jelveh merged 1 commit intoHeyPuter:mainfrom
pranav200408:my-fix-branch
Aug 17, 2025
Merged

fix(desktop): prevent horizontal scrolling by constraining window drag (#710)#1443
jelveh merged 1 commit intoHeyPuter:mainfrom
pranav200408:my-fix-branch

Conversation

@pranav200408
Copy link
Copy Markdown
Contributor

Pull Request

Issue Reference:
Fixes #710

Summary of Changes

1. Horizontal Scrolling Disabled on Desktop

  • Desktop container par horizontal scrolling disable kiya using jQuery.
  • Code added:
$('.desktop.item-container').css('overflow-x', 'hidden');
  • Result: Desktop par horizontal scroll ab nahi aayega.

2. Dragger Function Updated for Window Boundaries

  • .dragster options me drag event add kiya, taaki draggable window screen ke right edge ke bahar na ja sake.
  • Code added:
drag: function (dragsterEvent, event) {
  if (event && event.position && event.position.left) {
    const rightEdge = window.innerWidth - 30; // 30px margin
    if (event.position.left > rightEdge) {
      event.position.left = rightEdge;
    }
  }
}
  • Result: Drag karte waqt window hamesha screen ke andar rahegi, aur unwanted scrolling nahi hogi.

Files Changed

  • src/gui/src/UI/UIDesktop.js

Test Screenshots

  • Screenshot attached showing both VS Code changes and working app behavior.
Screenshot 2025-08-16 at 2 47 26 AM

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Pranav Agone seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jelveh
Copy link
Copy Markdown
Contributor

jelveh commented Aug 15, 2025

Thank you for this @pranav200408. Could you look into the CLA before I can review and merge?

@jelveh
Copy link
Copy Markdown
Contributor

jelveh commented Aug 16, 2025

The issue remains for me. Also, not allowing the window to be dragged out of the right edge is not a good idea. We allows this yet the window will bounce back to place where the left edge of the window would be visible.

@pranav200408
Copy link
Copy Markdown
Contributor Author

Changed logic: Now, window can be dragged out right, but left edge never leaves the screen as per feedback.
Screenshot 2025-08-16 at 3 12 57 PM

@jelveh
Copy link
Copy Markdown
Contributor

jelveh commented Aug 17, 2025

What is the screenshot about?!

@jelveh jelveh merged commit c93c296 into HeyPuter:main Aug 17, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Horizontal scrolling can occur in desktop

3 participants