Comments (44)
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.
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.
Would also be very interested in this feature.
from flameshot.
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.
Also need this feature. Waiting in hope!
from flameshot.
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.
great tool, the only thing I lack is the ability to screenshot a window. please make it available at least for x11!
from flameshot.
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.
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.
just copy the way shutter does it.
from flameshot.
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.
@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.
Sadly, that we lack of this feature for 6 years.
from flameshot.
@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.
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.
@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.
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.
from flameshot.
@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.
@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.
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.
@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.
Vote
from flameshot.
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.
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.
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.
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.
Also you can lookup Hotshots code as example of window selector: https://github.com/obiwankennedy/HotShots
from flameshot.
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.
I would love this feature!
from flameshot.
i love this suggest! π
from flameshot.
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.
This feature is so necessary :D
from flameshot.
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.
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.
is this a thing yet or am i blind?
from flameshot.
So, what about this feature? It's really easy way to get app screen instead of whole desktop.
from flameshot.
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.
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.
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.
@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.
@aryadovoy then checkout #1814
Pull request would be highly appreciated if you have the time to work on it
from flameshot.
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.
So this feature is still opening just because we MUST wait for Wayland?
from flameshot.
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)
- Flathub Verification
- Copy to clipboard not working on Wayland
- Option to disable upload HOT 1
- Imgur upload and Settings Configuration HOT 3
- Flamshot is automatically shutdown when choosing another tool while previous editing process is unfinished
- Draggable file handle for floating "Pin to desktop" screen captures?
- Image is darker after capture.
- Bad Pin Size And Positioning On 2880x1800 Monitor HOT 2
- Screenshot with -p (path) option hangs for 30+ seconds before finishing
- flameshot crash and I got kicked out to the login page after exit the app
- "flameshot gui" adds black bars on right and bottom of the screen HOT 2
- Magnifier can go off-screen if whole monitor setup isn't perfectly rectangular
- Updates and forks? HOT 6
- Allow taking interactive screenshots using only keyboard (`flameshot gui`)
- How to fix Print Screen Button on Windows 11
- βflameshotβ cannot be opened because the developer cannot be verified HOT 2
- Change the JPEG quality? HOT 1
- Image does not go to Clipboard
- Add function for Customer! HOT 1
- Two screens different resolutions [BUG] HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flameshot.