{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":736144259,"defaultBranch":"master","name":"flameshot","ownerLogin":"toofar","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2023-12-27T05:28:50.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/7419144?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1703806558.0","currentOid":""},"activityList":{"items":[{"before":"95f190cc72c507563155588cfe504f799ab23f4c","after":"cad55467d4454595d1f133d5731804fa67a1f346","ref":"refs/heads/feat/edit_pins","pushedAt":"2023-12-29T03:17:06.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Handle the old pin widget somehow being closed already\n\nThis is a bit of defensive coding that shouldn't normally be needed. I\nwas playing around with making the gui capture window support covering\nonly specific regions and managed to get the capture widget on a\ndifferent screen to the pin. Then closed the pin before finishing the\nnew capture. Then the existing.close() segfaulted because the reference\nto existing was invalid.\n\nIt would have been easier to just do something like `existing.isValid()`\nor `existing != nullptr` but apparently you can't check if a reference\nis valid? Seems weird, but hence the extra signal juggling to deal with\nthis case.\n\nThe new bit is mostly closePinConn and destroyedConn (which just cleans\nup the former). And I moved the \"disconnect everything\" to a separate\nvariable to be able to re-use it.","shortMessageHtmlLink":"Handle the old pin widget somehow being closed already"}},{"before":"63474185097a79e52c24ae55a62fb2e5ab86d065","after":"2e03f7d6af6c03d875c804d49b77916c35bb119c","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T23:53:04.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Fix editing pin on single screen on Windows\n\nThis commit fixes the single screen gui window positioning on windows.\nPreviously it was always on the leftmost screen.\n\nPreviously windows would always calculate `topLeft` based on looking at the\ntopmost and leftmost points of any screens. Presumably because it can't rely\non 0,0 being the top left of the desktop? It would be interesting to compare\nthat to ScreenGrabber.desktopGeometry().\n\nAnyway, when we only want to draw on a single window we either don't need to\ngo through all that effort or we should be combining the screen geometry with\nthe desktop geometry somehow. Like `ScreenGrabber.screenGeometry()` is doing.\nAlthough that method is doing it in a wayland only block so I can't see how it\napplies to windows...\n\nThis commit diff looks a bit messy but what it's doing is moving the windows\nspecific code into an else block inside #ifdefs.","shortMessageHtmlLink":"Fix editing pin on single screen on Windows"}},{"before":null,"after":"4676b6b0669b371e6ce455e6929e887192dbc9cd","ref":"refs/heads/wip/windows_geom_debugging","pushedAt":"2023-12-28T23:35:58.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Fix adjusting selection geometry when exporting from gui\n\nThe docs for `setTopLeft()` say\n\n \"Set the top-left corner of the rectangle to the given position. May\n change the size, but will never change the bottom-right corner of\n the rectangle.\"\n\nFor some reason on windows when calling `setTopLeft()` here when the\nwidget is at an offset it is moving the top left of the rect but not\nkeeping the size the same. I believe all we want to do here is move the\nrect, so this commit changes this adjustment to definitively do that.\nThere are various instances of `move()`, `moveTo()` and `moveTopLeft()`\nin the codebase, and only one other if `setTopLeft()`. I picked\n`moveTopLeft()` because it makes the diff smaller ;)\n\nThis error has the following implications 1) causing the pin widget\nto shift a little from where the selection was 2) causing the reported\ngeometry to not match the pixmap size, which didn't have much effect\nunless you wanted to use the geometry later (for example for allowing\nediting pins). I guess the pin widget got its size from the pixmap or\nsomething and that's why it wasn't huge?\n\nYou can reproduce this like so:\n\n* have a windows machine with two monitors\n* change the display settings so monitor one is to the right of monitor\n two (which causes monitor two to have a negative offset)\n* pin a selection and watch the pinned window shift a bit from where the\n selection was; or\n* observe this modified geometry somehow, like this patch which changes\n the size measurement painted on the selection widget to include the\n modified geometry alongside the original one:\n\n diff --git c/src/widgets/capture/capturewidget.cpp w/src/widgets/capture/capturewidget.cpp\n index 49ebff9720a0..16c7d04dbed6 100644\n --- c/src/widgets/capture/capturewidget.cpp\n +++ w/src/widgets/capture/capturewidget.cpp\n @@ -551,11 +633,18 @@ void CaptureWidget::paintEvent(QPaintEvent* paintEvent)\n QRect xybox;\n QFontMetrics fm = painter.fontMetrics();\n\n - QString xy = QString(\"%1x%2+%3+%4\")\n + QRect final_geometry(m_context.selection);\n + final_geometry.setTopLeft(final_geometry.topLeft() + m_context.widgetOffset);\n + QString xy = QString(\"%1x%2+%3+%4\\n%5x%6+%7+%8\")\n .arg(static_cast(selection.width() * scale))\n .arg(static_cast(selection.height() * scale))\n .arg(static_cast(selection.left() * scale))\n - .arg(static_cast(selection.top() * scale));\n + .arg(static_cast(selection.top() * scale))\n + .arg(static_cast(final_geometry.width() * scale))\n + .arg(static_cast(final_geometry.height() * scale))\n + .arg(static_cast(final_geometry.left() * scale))\n + .arg(static_cast(final_geometry.top() * scale))\n + ;\n\n xybox = fm.boundingRect(xy);\n // the small numbers here are just margins so the text doesn't\n\nhttps://doc.qt.io/qt-6/qrect.html#setTopLeft","shortMessageHtmlLink":"Fix adjusting selection geometry when exporting from gui"}},{"before":"e1188946e0583c9e99a74fd4ea3b865789a499a4","after":"63474185097a79e52c24ae55a62fb2e5ab86d065","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T23:19:34.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Fix adjusting select geometry before exporting from gui\n\nThe docs for `setTopLeft()` say\n\n \"Set the top-left corner of the rectangle to the given position. May\n change the size, but will never change the bottom-right corner of\n the rectangle.\"\n\nFor some reason on windows when calling `setTopLeft()` here when the\nwidget is at an offset it is moving the top left of the rect but not\nkeeping the size the same. I believe all we want to do here is move the\nrect, so this commit changes this adjustment to definitively do that.\nThere are various instances of `move()`, `moveTo()` and `moveTopLeft()`\nin the codebase, and only one other if `setTopLeft()`. I picked\n`moveTopLeft()` because it makes the diff smaller ;)\n\nYou can reproduce this like so:\n\n* have a windows machine with two monitors\n* change the display settings so monitor one is to the right of monitor\n two\n* observe this modified geometry somehow, like this patch which changes\n the size measurement painted on the selection widget to include the\n modified geometry alongside the original one:\n\n diff --git c/src/widgets/capture/capturewidget.cpp w/src/widgets/capture/capturewidget.cpp\n index 49ebff9720a0..16c7d04dbed6 100644\n --- c/src/widgets/capture/capturewidget.cpp\n +++ w/src/widgets/capture/capturewidget.cpp\n @@ -551,11 +633,18 @@ void CaptureWidget::paintEvent(QPaintEvent* paintEvent)\n QRect xybox;\n QFontMetrics fm = painter.fontMetrics();\n\n - QString xy = QString(\"%1x%2+%3+%4\")\n + QRect final_geometry(m_context.selection);\n + final_geometry.setTopLeft(final_geometry.topLeft() + m_context.widgetOffset);\n + QString xy = QString(\"%1x%2+%3+%4\\n%5x%6+%7+%8\")\n .arg(static_cast(selection.width() * scale))\n .arg(static_cast(selection.height() * scale))\n .arg(static_cast(selection.left() * scale))\n - .arg(static_cast(selection.top() * scale));\n + .arg(static_cast(selection.top() * scale))\n + .arg(static_cast(final_geometry.width() * scale))\n + .arg(static_cast(final_geometry.height() * scale))\n + .arg(static_cast(final_geometry.left() * scale))\n + .arg(static_cast(final_geometry.top() * scale))\n + ;\n\n xybox = fm.boundingRect(xy);\n // the small numbers here are just margins so the text doesn't\n\nhttps://doc.qt.io/qt-6/qrect.html#setTopLeft","shortMessageHtmlLink":"Fix adjusting select geometry before exporting from gui"}},{"before":"fb70e9cbdbc263dffa4b9fc54decc46bd2ece08b","after":"e1188946e0583c9e99a74fd4ea3b865789a499a4","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T22:42:35.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: found it! more debugging\n\nAha, it's definitely the\nfinal_geometry.setTopLeft(final_geometry.topLeft() +\nm_context.widgetOffset) manipulation in the destructor. But why is this\nmodifying the width and height? Maybe we should just be using move()\nanyhow?","shortMessageHtmlLink":"wip: found it! more debugging"}},{"before":"c4f98adc82cd00970a3a65ff930a671a51172d0d","after":"fb70e9cbdbc263dffa4b9fc54decc46bd2ece08b","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T22:01:24.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: make sure the final geometry line shows up...","shortMessageHtmlLink":"wip: make sure the final geometry line shows up..."}},{"before":"8b4f9f8824748c14291f9c634f9082894833bec1","after":"c4f98adc82cd00970a3a65ff930a671a51172d0d","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T21:48:24.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"fixup! wip: emulate geom change before export","shortMessageHtmlLink":"fixup! wip: emulate geom change before export"}},{"before":"227f6e5f986bee79903414f8cddd2e63c509030e","after":"8b4f9f8824748c14291f9c634f9082894833bec1","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T21:42:28.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: emulate geom change before export","shortMessageHtmlLink":"wip: emulate geom change before export"}},{"before":"2e3970784cb69c3b81775011ca63549beb99bc18","after":"227f6e5f986bee79903414f8cddd2e63c509030e","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T12:14:57.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Examine m_context.selection too\n\nOn windows, when screen 1 is to the right of screen two, the offsets of\nscreen 2 are negative. When pinning a screenshot on screen one the width\nof the pinned image somehow gets a whole screen width added to it. I'm\nnot sure where this comes from.\n\nDebugging where the pin widget gets created from I see this stack:\n\n PinWidget::PinWidget\n FlameshotDaemon::attachPin\n FlameshotDaemon::createPin\n Flameshot::exportCapture\n CaptureWidget::~CaptureWidget\n\nThe extra width is evidenced in the initial geometry passed to the pin\nwidget. Although that doesn't explain why the pin widget is the correct\nsize...\n\nAnyway, double checking that both selection variables in the capture\nwidget is worth doing.","shortMessageHtmlLink":"Examine m_context.selection too"}},{"before":"a84f90ee187431698c08943fdefe434fb20eb3fd","after":"2e3970784cb69c3b81775011ca63549beb99bc18","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T11:24:19.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: add initial selection to debug text","shortMessageHtmlLink":"wip: add initial selection to debug text"}},{"before":"f8fbcb498c461fe5ed2645fdbdd72787d60f706e","after":"a84f90ee187431698c08943fdefe434fb20eb3fd","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T10:59:20.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"xxx: comment ifdefs back out, swap pos display, copy topleft\n\nWindows is being so inconsistent...","shortMessageHtmlLink":"xxx: comment ifdefs back out, swap pos display, copy topleft"}},{"before":"de7aa931f4eb6e8bbfcbadcfdf7884a0e0308634","after":"f8fbcb498c461fe5ed2645fdbdd72787d60f706e","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T10:50:47.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"xxx: comment ifdefs back out, swap pos display, copy topleft\n\nWindows is being so inconsistent...","shortMessageHtmlLink":"xxx: comment ifdefs back out, swap pos display, copy topleft"}},{"before":"6cc5472787ef7c263a4686ca2f52b26fc07e4459","after":"de7aa931f4eb6e8bbfcbadcfdf7884a0e0308634","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T10:06:22.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: and pixel ratio","shortMessageHtmlLink":"wip: and pixel ratio"}},{"before":"5b1b0d9fbbffff0707bfa7ebe599332a539c7337","after":"6cc5472787ef7c263a4686ca2f52b26fc07e4459","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T09:43:32.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"xxx: add debugging to pin widget","shortMessageHtmlLink":"xxx: add debugging to pin widget"}},{"before":"31861d9b42bb9811b4627a44a5cb1ac67e499261","after":"5b1b0d9fbbffff0707bfa7ebe599332a539c7337","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T08:39:32.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: maybe fix windows initial wrong pin offset\n\nOn windows when you have two monitors and they aren't lined up at the\ntop perfectly, then when you pin a selection the pin window ends up\njumping a little bit. Specifically it seems to be half of the screen's\ny-offset from the global 0?\n\nWill this fix it? Not sure.\n\nIt seems some global measurement needs to be mapped to local? Maybe?","shortMessageHtmlLink":"wip: maybe fix windows initial wrong pin offset"}},{"before":"fdfad5008c0033a9bcdf9a79bd91a8a0953322ce","after":"31861d9b42bb9811b4627a44a5cb1ac67e499261","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T08:24:31.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: maybe fix windows initial wrong pin offset\n\nOn windows when you have two monitors and they aren't lined up at the\ntop perfectly, then when you pin a selection the pin window ends up\njumping a little bit. Specifically it seems to be half of the screen's\ny-offset from the global 0?\n\nWill this fix it? Not sure.\n\nIt seems some global measurement needs to be mapped to local? Maybe?","shortMessageHtmlLink":"wip: maybe fix windows initial wrong pin offset"}},{"before":"e7cfb979d07c2fd5d58e6b70145f60c0c170a98b","after":"fdfad5008c0033a9bcdf9a79bd91a8a0953322ce","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T07:12:50.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip: fix editing pin on single screen on windows\n\nPreviously windows would always calculate `topLeft` based on looking at the\ntopmost and leftmost points of any screens. Presumably because it can't rely\non 0,0 being the top left of the desktop? It would be interesting to compare\nthat to ScreenGrabber.desktopGeometry().\n\nAnyway, when we only want to draw on a single window we either don't need to\ngo through all that effort or we should be combing the screen geometry with\nthe desktop geometry somehow. Like `ScreenGrabber.screenGeometry()` is doing.\nAlthough that method is doing it in a wayland only block so I can't see how it\napplies to windows...\n\nThis commit diff looks a bit messy but what it's doing is moving the windows\nspecific code into an else block inside #ifdefs.","shortMessageHtmlLink":"wip: fix editing pin on single screen on windows"}},{"before":"040d4021422aa630de61b823b9f57cec1f3ca5fa","after":"e7cfb979d07c2fd5d58e6b70145f60c0c170a98b","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T05:12:06.000Z","pushType":"push","commitsCount":4,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"wip","shortMessageHtmlLink":"wip"}},{"before":"d2880c77d4cd22fe9dc4991af1ae7a7095734d64","after":"040d4021422aa630de61b823b9f57cec1f3ca5fa","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T02:35:17.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"XXX: run windows packaging workflow on all branches","shortMessageHtmlLink":"XXX: run windows packaging workflow on all branches"}},{"before":null,"after":"d2880c77d4cd22fe9dc4991af1ae7a7095734d64","ref":"refs/heads/feat/single_screen_gui_mode","pushedAt":"2023-12-28T02:33:38.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"XXX: run windows packaging workflow on all branches","shortMessageHtmlLink":"XXX: run windows packaging workflow on all branches"}},{"before":"9228e46588c7bcc2ae6d49875db8855f2bee6d78","after":"95f190cc72c507563155588cfe504f799ab23f4c","ref":"refs/heads/feat/edit_pins","pushedAt":"2023-12-27T05:46:03.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Add method of editing a pinned screenshot\n\nAdd a method to allow editing a pinned screenshot by initiating a new\nscreenshot over top of the pinned image, and then closing the old pinned image\non success.\n\nThis adds a new context menu to pinned screenshots. When selected the\nPinWidget will call the daemon to do the work. Thus this functionality only\nworks when flameshot is running in daemon mode. The context menu options don't\nshow up when not running in daemon mode (I don't know why they don't show up,\nother ones like the rotate and opacity ones also don't show up).\n\nThis is not the ideal method of doing this, it doesn't actually edit the\nscreenshot at all. I call it the \"bait and switch\" method of editing. The only\nprevious attempt that I've soon to do this got caught up in dealing with\nscreens with different DPI (pull/1565). While it would be amazing to be able\nto limit the whole \"grab\" region to be less than a screen, or even just one\nscreen, I think this method of editing a pin in the full desktop cature mode\nis a step forward. It sure is for my workflow anyhow.\n\nI'm not familiar with c++ or this codebase so if there looks to be anything\nweird in this PR it's probably due to ignorance.\n\nI'm calling FlameshotDaemon from PinWidget, I'm not sure if I should be doing\nthat or trying to access the Flameshot singleton directly, I just copied off\nof another tool which called `FlameshotDaemon::copyToClipboard()`.\n\nI'm not sure if doing `.geometry() - .layout()->contentsMargins()` is the\ncorrect way to get the image geometry, I was guided by what attributes I could\nsee in GammaRay while inspecting a running flameshot.\n\nThe method of disconnecting from the signals from within the lambdas is from\nhere: https://stackoverflow.com/questions/14828678/disconnecting-lambda-functions-in-qt5\n\nI contemplated calling the method in Flameshot \"replacePin\" or\n\"captureFromPin\" or something more technically accurate. But I figured the\nsignature could stay a bit optimistic and if people would like the behaviour\nto be firmed up to match the goal in the future that could be done. Eg add\nfunctionality to the CaptureWidget to make it so you can't modify the capture\nregion, change the grab region to be less than the whole desktop etc.\n\nKnown issues:\n\n* you can move/resize the selection region, eg not just edit a pin but create\n a completely different one of a different region of the screen\n\nRelates to: https://github.com/flameshot-org/flameshot/issues/954","shortMessageHtmlLink":"Add method of editing a pinned screenshot"}},{"before":"42d33c822c710d94f08024540c9c74dc68b26aac","after":"9228e46588c7bcc2ae6d49875db8855f2bee6d78","ref":"refs/heads/feat/edit_pins","pushedAt":"2023-12-27T05:43:20.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Add method of editing a pinned screenshot\n\nAdd a method to allow editing a pinned screenshot by initiating a new\nscreenshot over top of the pinned image, and then closing the old pinned image\non success.\n\nThis adds a new context menu to pinned screenshots. When selected the\nPinWidget will call the daemon to do the work. Thus this functionality only\nworks when flameshot is running in daemon mode. The context menu options don't\nshow up when not running in daemon mode (I don't know why they don't show up,\nother ones like the rotate and opacity ones also don't show up).\n\nThis is not the ideal method of doing this, it doesn't actually edit the\nscreenshot at all. I call it the \"bait and switch\" method of editing. The only\nprevious attempt that I've soon to do this got caught up in dealing with\nscreens with different DPI (pull/1565). While it would be amazing to be able\nto limit the whole \"grab\" region to be less than a screen, or even just one\nscreen, I think this method of editing a pin in the full desktop cature mode\nis a step forward. It sure is for my workflow anyhow.\n\nI'm not familiar with c++ or this codebase so if there looks to be anything\nweird in this PR it's probably due to ignorance.\n\nI'm calling FlameshotDaemon from PinWidget, I'm not sure if I should be doing\nthat or trying to access the Flameshot singleton directly, I just copied off\nof another tool which called `FlameshotDaemon::copyToClipboard()`.\n\nI'm not sure if doing `.geometry() - .layout()->contentsMargins()` is the\ncorrect way to get the image geometry, I was guided by what attributes I could\nsee in GammaRay while inspecting a running flameshot.\n\nThe method of disconnecting from the signals from within the lambdas is from\nhere: https://stackoverflow.com/questions/14828678/disconnecting-lambda-functions-in-qt5\n\nI contemplated calling the method in Flameshot \"replacePin\" or\n\"captureFromPin\" or something more technically accurate. But I figured the\nsignature could stay a bit optimistic and if people would like the behaviour\nto be firmed up to match the goal in the future that could be done. Eg add\nfunctionality to the CaptureWidget to make it so you can't modify the capture\nregion, change the grab region to be less than the whole desktop etc.\n\nKnown issues:\n\n* you can move/resize the selection region, eg not just edit a pin but create\n a completely different one of a different region of the screen\n\nRelates to: https://github.com/flameshot-org/flameshot/issues/954","shortMessageHtmlLink":"Add method of editing a pinned screenshot"}},{"before":null,"after":"42d33c822c710d94f08024540c9c74dc68b26aac","ref":"refs/heads/feat/edit_pins","pushedAt":"2023-12-27T05:30:37.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"toofar","name":null,"path":"/toofar","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7419144?s=80&v=4"},"commit":{"message":"Add method of editing a pinned screenshot\n\nAdd a method to allow editing a pinned screenshot by initiating a new\nscreenshot over top of the pinned image, and then closing the old pinned image\non success.\n\nThis adds a new context menu to pinned screenshots. When selected the\nPinWidget will call the daemon to do the work. Thus this functionality only\nworks when flameshot is running in daemon mode. The context menu options don't\nshow up when not running in daemon mode (I don't know why they don't show up,\nother ones like the rotate and opacity ones also don't show up).\n\nThis is not the ideal method of doing this, it doesn't actually edit the\nscreenshot at all. I call it the \"bait and switch\" method of editing. The only\nprevious attempt that I've soon to do this got caught up in dealing with\nscreens with different DPI (pull/1565). While it would be amazing to be able\nto limit the whole \"grab\" region to be less than a screen, or even just one\nscreen, I think this method of editing a pin in the full desktop cature mode\nis a step forward. It sure is for my workflow anyhow.\n\nI'm not familiar with c++ or this codebase so if there looks to be anything\nweird in this PR it's probably due to ignorance.\n\nI'm calling FlameshotDaemon from PinWidget, I'm not sure if I should be doing\nthat or trying to access the Flameshot singleton directly, I just copied off\nof another tool which called `FlameshotDaemon::copyToClipboard()`.\n\nI'm not sure if doing `.geometry() - .layout()->contentsMargins()` is the\ncorrect way to get the image geometry, I was guided by what attributes I could\nsee in GammaRay while inspecting a running flameshot.\n\nThe method of disconnecting from the signals from within the lambdas is from\nhere: https://stackoverflow.com/questions/14828678/disconnecting-lambda-functions-in-qt5\n\nI contemplated calling the method in Flameshot \"replacePin\" or\n\"captureFromPin\" or something more technically accurate. But I figured the\nsignature could stay a bit optimistic and if people would like the behaviour\nto be firmed up to match the goal in the future that could be done. Eg add\nfunctionality to the CaptureWidget to make it so you can't modify the capture\nregion, change the grab region to be less than the whole desktop etc.\n\nKnown issues:\n\n* you can move/resize the selection region, eg not just edit a pin but create\n a completely different one of a different region of the screen\n\nRelates to: https://github.com/flameshot-org/flameshot/issues/954","shortMessageHtmlLink":"Add method of editing a pinned screenshot"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAD09KgsQA","startCursor":null,"endCursor":null}},"title":"Activity ยท toofar/flameshot"}