Git Product home page Git Product logo

Comments (44)

Naatan avatar Naatan commented on May 11, 2024 60

Why not add it for X11 and then add it for Wayland once it becomes available? I don't see why applications should suffer because Wayland can't keep up. If anything stuff like this will urge Wayland to add support for it.

from flameshot.

lupoDharkael avatar lupoDharkael commented on May 11, 2024 24

I'm thinking about implementing window detection using shape detection in the image itself. That way it wont depend on the desktop environment and could be easier to port Flameshot to other systems someday.
I'll try to find a self-contained solution for rectangle detection because I don't what to add a heavy dependency like OpenCV.

from flameshot.

imtbl avatar imtbl commented on May 11, 2024 23

Would also be very interested in this feature.

from flameshot.

lupoDharkael avatar lupoDharkael commented on May 11, 2024 16

I agree, and now I think it's better to support native mechanics for window selection as a separated mode.

I plan to release a new version soonβ„’ when I end the exams.
This could be implemented for Flameshot 0.7 (I'd like to push more features but my time is limited)

from flameshot.

KiriKira avatar KiriKira commented on May 11, 2024 13

Also need this feature. Waiting in hope!

from flameshot.

azzamsa avatar azzamsa commented on May 11, 2024 10

Or just copy on how maim did it. maim -i $(xdotool getactivewindow) filename.png

This is the only feature I miss when leaving maim for flameshot.

from flameshot.

Metadorius avatar Metadorius commented on May 11, 2024 9

great tool, the only thing I lack is the ability to screenshot a window. please make it available at least for x11!

from flameshot.

Flimm avatar Flimm commented on May 11, 2024 8

For those looking for a workaround, in GNOME, you can press Alt-PrintScreen, and it will save a screenshot of the currently active window in your Pictures directory.

from flameshot.

JaneSmith avatar JaneSmith commented on May 11, 2024 7

I'd like a window screenshot feature that can work like this: https://askubuntu.com/questions/50604/application-for-taking-pretty-screenshots-like-os-x-does

from flameshot.

elypter avatar elypter commented on May 11, 2024 7

just copy the way shutter does it.

from flameshot.

ndac-todoroki avatar ndac-todoroki commented on May 11, 2024 7

I'll try to find a self-contained solution for rectangle detection

This is certainly cool, but there are problems... if a window have transparent surroundings, and if you want to include that too, I'm afraid you can not detect the correct area to capture.

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024 7

@wael444 no it is not a thing yet. You can follow some if the discussions in #1814

If you want this now and you are on Linux and using X11, you can use this wrapper tool I wrote to do it:

https://codeberg.org/mehrad/dmenu_shot

Basically when you use the "Select_Window" it will allow you to click on one of your open windows and then it automatically handles the dimension of the selection.

from flameshot.

KES777 avatar KES777 commented on May 11, 2024 7

Sadly, that we lack of this feature for 6 years.

from flameshot.

harold avatar harold commented on May 11, 2024 7

@mmahmoudian - thank you for this! I was able to adapt your code to a short script that works well for me under x11/i3:

#!/bin/bash
TMP_WINDOW_ID=$(xdotool selectwindow)
unset WINDOW X Y WIDTH HEIGHT SCREEN
eval $(xdotool getwindowgeometry --shell "${TMP_WINDOW_ID}")
xdotool windowfocus --sync "${TMP_WINDOW_ID}"
sleep 0.05
flameshot gui --region "${WIDTH}x${HEIGHT}+${X}+${Y}"

Ignore the haters, you're doing great! Thank you for all the efforts. πŸ™‡

from flameshot.

demizer avatar demizer commented on May 11, 2024 4

This is a great tool, but it needs window selection. Also, it should be possible to add a dropshadow to make it similar to the way macOS takes screenshots.

from flameshot.

aryadovoy avatar aryadovoy commented on May 11, 2024 3

@mmahmoudian, I see solution for all platforms β€” parsing image and cropping active window (mouse should be on this window to get position and determine which window should be parsed and cropped). Maybe it's too much, but it should work everywhere. :)

from flameshot.

 avatar commented on May 11, 2024 2

Would highly appreciate GUI mode for Flameshot especially as windows user. That's a feature that I've been missing with Flameshot that has been available with Snip & Sketch / snipping bar.

Edit: Not "GUI mode" that's nonsense I wrote. I wanna be able to do a selection of a window inside of the Flameshot GUI. Like OP wants. Just on Windows (OS) too. That is visible inside the GUI I probably meant by GUI mode like it is available and visible as icon or option to chose with the snipping bar in Windows.

The third icon representing the window selection option. Otherwise we might have to wait for:
[ ] computer vision for rectangles selection (as in firefox screenshot)
Which in similar manner is already present with ShareX and would probably fullfill the very same issue.

grafik

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024 2

@friday there is no image processing method in existence that can handle this case unless there are some other visual cues. The worst case scenario is having a borderless black terminal with opaque background which all its area is inside another slightly larger terminal. No machine learning method can dig that out unless it can get some extra information based on text or window decoration.

I think if we end up using any image processing method, we should not consider edge cases and we should just go with typical and normal cases. The ideal case would be that we can read window dimension and position info from Qt as it has no overhead on our side.

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024 2

@KES777 Please avoid cross posting. It does mot help anyone and will only clutter the issues and make me to work more that what it needs to keep the issues tidy.

This in already very easy to do in X11 (have been possible for over a year). It is not possible on wayland though.

For X11 I have implemented this in a personal project under "selec window", and you can salvage the code:

https://codeberg.org/mehrad/dmenu_shot

from flameshot.

MithicSpirit avatar MithicSpirit commented on May 11, 2024 1

I don't use Windows but the Linux version does have a GUI version (it can be started by either executing flameshot gui or through the system tray icon). That isn't exactly what this issue is discussing though so I think that if you can't start it maybe create a new issue.

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024 1

@aryadovoy if you want a quick way to do it with Flameshot in Linux on X11, you can use the Select_Window in this dmenu tool:
https://codeberg.org/mehrad/dmenu_shot

from flameshot.

CholoTook avatar CholoTook commented on May 11, 2024 1

Vote

from flameshot.

friday avatar friday commented on May 11, 2024 1

It could indeed be possible to use some kind of edge detection, but it would have to make some assumptions. You wouldn't be able to detect a black terminal window with a borderless theme on a black background for example.

from flameshot.

XieJiSS avatar XieJiSS commented on May 11, 2024 1

This feature is quite needed anyway, despite the thread being inactive for nearly a year - should we pick this up again and consider how to implement it?

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024 1

So this feature is still opening just because we MUST wait for Wayland?

No, it is open because we need someone to consider helping implementing it. If you are up for it, PRs are definitely welcome

from flameshot.

lupoDharkael avatar lupoDharkael commented on May 11, 2024

A windows selection mode is great, but there is a problem with it:
I want to add support for Wayland, and the protocol doesn't support knowing where the windows are and its properties. Which makes adding such feature a very problematic thing to manage in such migration.

from flameshot.

MurzNN avatar MurzNN commented on May 11, 2024

Also you can lookup Hotshots code as example of window selector: https://github.com/obiwankennedy/HotShots

from flameshot.

slondr avatar slondr commented on May 11, 2024

Any update on this feature? Lacking window selection support is probably the only thing that makes me keep Shutter installed instead of just using Flameshot for everything.

from flameshot.

jameswilliamknight avatar jameswilliamknight commented on May 11, 2024

I would love this feature!

from flameshot.

decryp2kanon avatar decryp2kanon commented on May 11, 2024

i love this suggest! πŸ‘

from flameshot.

Massimo-B avatar Massimo-B commented on May 11, 2024

I agree my #799 could be solved by this like Left-Click to snapshot the window instead of a command line parameter. Just an option for including window decoration or not would be helpful.

from flameshot.

tiotrom avatar tiotrom commented on May 11, 2024

This feature is so necessary :D

from flameshot.

tiotrom avatar tiotrom commented on May 11, 2024

For those looking for a workaround, in GNOME, you can press Alt-PrintScreen, and it will save a screenshot of the currently active window in your Pictures directory.

Oh awesome. This is so useful honestly! Thanks a lot. Had no idea

from flameshot.

MithicSpirit avatar MithicSpirit commented on May 11, 2024

I want to add support for Wayland, and the protocol doesn't support knowing where the windows are and its properties.

Has there been any change on this? Or are we still waiting on that being added to the protocol?

from flameshot.

apprehensions avatar apprehensions commented on May 11, 2024

is this a thing yet or am i blind?

from flameshot.

aryadovoy avatar aryadovoy commented on May 11, 2024

So, what about this feature? It's really easy way to get app screen instead of whole desktop.

from flameshot.

borgmanJeremy avatar borgmanJeremy commented on May 11, 2024

It's not going to happen unless qt adds a way to do this. It will be a nightmare to manage it across desktop environments and operating systems.

from flameshot.

WebDust21 avatar WebDust21 commented on May 11, 2024

Just installed Flameshot...and found this issue less than 10 minutes later while looking for a way to do just this...

It's not impossible to do in Linux, as both GIMP and Spectacle can "capture active window" without an issue.

Yes, transparent edges are a minor issue--GIMP simply captures the entire transparent edge (including what's visible behind it). We don't necessarily need a "perfect" solution, just a way to have Flameshot automatically select the active window (command line shortcut activated with Ctrl + PrntScrn, for example)

from flameshot.

borgmanJeremy avatar borgmanJeremy commented on May 11, 2024

It's not impossible on any platform but I am not going to merge something that is unmaintainable. We need a clear strategy for how to do this in a cross platform / cross desktop way.

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024

@WebDust21 I 100% agree with @borgmanJeremy. Whatever the solution is, it should be cross-platform unless and until we have no choice.

If you are on X11 and want to do it, there are many easy ways to do so. Take a look at this project of mine in which you can select the window and it will tell Flameshot to focus on that area. You ca either use the software or grab that relevant piece of code.

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024

@aryadovoy then checkout #1814
Pull request would be highly appreciated if you have the time to work on it

from flameshot.

mmahmoudian avatar mmahmoudian commented on May 11, 2024

should we pick this up again and consider how to implement it?

Sure, if you are up for it. PRs are always welcome. But I have to hide your comment as it does not add anything constructive to the thread and discussion.

from flameshot.

sakurawald avatar sakurawald commented on May 11, 2024

So this feature is still opening just because we MUST wait for Wayland?

from flameshot.

RokeJulianLockhart avatar RokeJulianLockhart commented on May 11, 2024

We could ask the current window managers to separate their window detection code into a library or libraries, I suppose.

Heck, we could just take theirs, do it for them, and then say

"Hey, we consolidated all your code, want to use this and pool our development resources?"

It seems more feasible than image detection, at least.

from flameshot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.