xorg source code copy paste - linux

Anybody knows where in xorg source code is located copy/paste routine which is bind to left(copy) and middle(paste) mouse buttons?
More datails:
When you select any text in X session by using left mouse button (normal text selection), it is copied to some "clipboard". Next, when you click middle mouse button in any input control/window text is pasted.
Why I need it:
I need it because I want to change this functionality a little. It is very useful comparing to MsWindows Ctrl-c Ctrl-v. Much faster. But it would be even more if under some button we can reach for previous clipboard content. In this case we can replace one text by other like this:
selecting text A
selecting destination text B (in this moment under middle button text A was overwritten by B)
paste text A using SOME button (not middle button)

It's not in the Xorg source code, but in the sources for each X toolkit or application. The X server simply sends the application the mouse button events, which get processed through its event handling to whatever functions they've bound to those buttons. The copy & paste mechanism you describe is a common convention most toolkits & applications have implemented in their own fashions.
You can read much more about this mechanism in the specs under Peer-to-Peer Communication by Means of Selections in the Inter-Client Communication Conventions Manual

Related

How to toggle the external screen in Windows 10

I have a laptop connected to an external monitor. Need to do a presentation where I have Powerpoint open on one screen and Excel on another screen and toggle the external screen
So: the laptop screen should always show Excel but the external screen should show either PP or Excel.
I put display into extended mode, put PP on a second screen. so far so good. But then I need to switch external screen to Excel. If I change to Duplicate mode, my PP moves to the main screen and I cannot switch easily back.
Is there a way to quickly and easy switch only the external monitor between main and extended screens?
You need to be on Extended Mode always. Based on your requirement, you can manually drag the respective Application (in your case Excel/PowerPoint) to whichever screen you want.
You also can tweak the PowerPoint Slide Show setting to define which monitor to use and also whether to use Presenter View or not (refer screenshot)
Hope this helps!

How can I set the default orientation of labview windows?

Whenever I open a new labview project, it opens two small windows, one for the block diagram and the front panel. Since using labview effectively requires simultaneous use of both, is it possible to set things up such that, upon starting a new VI, it opens these two windows in pre-determined positions and sizes?
I do not know setting to do so (and think there is no such setting), but your problem is easily solvable if you press ctrl+t when new vi is opened.
ctrl+t will set front panel on the left half part of the screen and block diagram on the right part. Pressing ctrl+t a second time will set the panel to top half and diagram to the bottom half.
Shortcuts In LabVIEW
Another workaround:
Create a new empty VI
Resize and reposition the front panel window as you wish
Do the same for the block diagram window
Save the VI as a template (.vit)
Double click the template to use it (position and size of windows will be as they were when saving)
Alternatively if you want to be doing manually everytime. You can press WIN+LEFT on one of the windows and WIN+RIGHT on the other. This will evenly distribute the two windows over the screen.
You can set window position for individual VIs by pressing Ctrl+I to open the VI properties, and setting the desired appearance under "Window Size"

PyQt QTextEdit text selection without moving the cursor (like ubuntu terminal)

I've developed a shell (imitating the ubuntu terminal --> can only edit text after current prompt) by a PyQt QTextEdit.
The thing is when I select some text, the cursor moves as I'm selecting this text (so it disappers from the current command line) and I would like the cursor to stay where it is (only when I select text because I want it to move when I move it programmatically by textEdit.moveCursor(...)) at the same time I'm selecting the text.
Does anybody have any idea of how could I do that?
My solution for now, is to save the position at any change of it (except when it changes by a click), and when I copy some text en paste it, it'll be automatically pasted in the last position the cursor was before the click. That works perfectly but it's "ugly" for the user because, as I said, when he selects the text the cursor disappears of the current line and is where the user is selecting the text. Not like in ubuntu terminal.
Thanks in advance! And sorry for my english.
Adri
I don't see an easy solution to implement this with a text editor API. A terminal is a hack, basically. It mixes a read-only element (anything above the current prompt) with a text editor.
My approach would be to create two text editors, make one read only and display the results of all operations there. If you hide the borders of the two editors, then it will look like a single one. You may have to forward a bunch of events (like scrolling with the keyboard) to the read-only display.

FLTK Fl_Window inside another Fl_Window?

Can I insert one window inside another? It must be full feature, so that it receives mouse events, can be focused for keyboard input (or disabled to not receive), could be resized and have an ondraw. Can you give an example or describe?

Move command in Dialog based aplications

I working on Dialog based applications once i right click on the Dialog Title bar a drop down list is coming with two options 1. Move and 2. Alt+F4 close. Once the User Press Move and he can able to drag the window as he desired and I add the On NC Hits Test to stop dragging its stopping normal dragging but it is not working in this particular context can any body help me in fixing this Bug.
When the user use the keyboard interface, he can move a windows with the arrow keys, without using the mouse.
If you want to limit the position of your dialog, process the WM_MOVING message.

Resources