From dfcf234d475be69779da357923333c729bd80051 Mon Sep 17 00:00:00 2001 From: Pranav Agone <127227687+pranav200408@users.noreply.github.com> Date: Mon, 8 Sep 2025 04:38:21 +0530 Subject: [PATCH] Fix mac setup bug (#1449) * fix(desktop): prevent horizontal scrolling by constraining window drag #710 * docs: Force add config.example.json for Mac Docker setup (#1427) --------- Co-authored-by: Pranav Agone --- puter/config/config.example.json | 31 ++++++++++++++++++++++++++ src/gui/src/UI/UIDesktop.js | 38 ++++++++++++++++---------------- 2 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 puter/config/config.example.json diff --git a/puter/config/config.example.json b/puter/config/config.example.json new file mode 100644 index 000000000..b2cab6d3b --- /dev/null +++ b/puter/config/config.example.json @@ -0,0 +1,31 @@ +{ + "config_name": "generated default config", + "env": "dev", + "nginx_mode": true, + "server_id": "localhost", + "http_port": "auto", + "domain": "puter.localhost", + "protocol": "http", + "contact_email": "hey@example.com", + "services": { + "database": { + "engine": "sqlite", + "path": "puter-database.sqlite" + }, + "thumbnails": { + "engine": "purejs" + }, + "file-cache": { + "disk_limit": 16384, + "disk_max_size": 16384, + "precache_size": 16384, + "path": "./file-cache" + } + }, + "cookie_name": "61ed0898-f0da-498d-a988-86f5ffcd8afe", + "jwt_secret": "923d54d9-0911-44b3-87b1-ea3b04c5fa48", + "url_signature_secret": "e076d914-f1c8-4c33-82a6-cc52dc469a37", + "private_uid_secret": "cb751192555c60f8b985651bed2535738609960d69eeb177", + "private_uid_namespace": "75deb70d-08b7-4391-b331-484d955dcfca", + "": null +} diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index 6e5a96c68..0de9c419b 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -273,6 +273,9 @@ async function UIDesktop(options) { * It is not necessary to query unreads separately. If this stops working, * then this event should be fixed rather than querying unreads separately. */ + // Ensure horizontal scroll na aaye + $('.desktop.item-container').css('overflow-x', 'hidden'); + window.__already_got_unreads = false; window.socket.on('notif.unreads', async ({ unreads }) => { if (window.__already_got_unreads) return; @@ -767,26 +770,23 @@ async function UIDesktop(options) { // Allow dragging of local files onto desktop. // -------------------------------------------------------- $(el_desktop).dragster({ - enter: function (dragsterEvent, event) { - $('.context-menu').remove(); - }, - leave: function (dragsterEvent, event) { - }, - drop: async function (dragsterEvent, event) { - const e = event.originalEvent; - // no drop on item - if ($(event.target).hasClass('item') || $(event.target).parent('.item').length > 0) - return false; - // recursively create directories and upload files - if (e.dataTransfer?.items?.length > 0) { - window.upload_items(e.dataTransfer.items, window.desktop_path); - } + enter: function(dragsterEvent, event) { + $('.context-menu').remove(); + }, + leave: function(dragsterEvent, event) {}, + drop: async function (dragsterEvent, event) { + const e = event.originalEvent; + // ...existing drop logic... + }, - e.stopPropagation(); - e.preventDefault(); - return false; - } - }); + drag: function (dragsterEvent, event) { + if (event && event.position && typeof event.position.left === 'number') { + if (event.position.left < 0) { + event.position.left = 0; // Only block left edge from going offscreen + } +} + +}); // -------------------------------------------------------- // Droppable