X11 window resizing stutters
https://tronche.com/gui/x/xlib/events/window-state-change/configure.html
https://tronche.com/gui/x/xlib/events/structure-control/resize.html
From what I can read from those two links ConfigureNotify happens when a change has completed. ResizeRequest happens when a resize is attempted. Specifically:
The X server can report ResizeRequest events to clients wanting
information about another client's attempts to change the size of a
window.
I don´t like the sound of "CAN report", but I suppose you should give it a shot. Don´t forget to set proper event bit as instructed in the link. As for what you should do when capturing event I´m not too sure... I would clear the front buffer and await resize to complete.
X11 in C++ - Cropping happens whenever ResizeRedirectMask is set when the window is resized
ResizeRedirectMask
is irrelevant for your purposes. You never want it unless you are writing a window manager. You need StructureNotifyMask
. You should virtually always select this mask (maybe unless your window never gets resized).
If you do not select StructureNotifyMask
, your window never gets actual resize events and does not get a chance to respond to them.
When you get a ConfigureNotify
event, which will only happen if you select StructureNotifyMask
, it will contain the new actual geometry, so your window can update itself.
X11 Window isn't updating/drawing automatically
The XNextEvent function copies the first event from the event queue into the
specified XEvent structure and then removes it from the queue. If the event
queue is empty, XNextEvent flushes the output buffer and blocks until an event
is received.
So, your call to XNextEvent
waits until some event happens, and only then redraws. Worse, it redraws on every event, so if multiple events happen, you'll only know that after several frames.
You should use XCheckWindowEvent
instead, and re-organise your loop (handle all events first, then render).
Fail to display any image via X11
Having a blank window is the correct behaviour for calling X11()
. Usually, you won't need to call that function, but it means that you can specify how tall/wide the plot window is before you create a plot.
If you still have a blank window after you try and plot something, then you are probably writing to a different device.
Have you opened another device (maybe with png
, etc.) and forgotten to close it?
What does dev.cur()
return?
A reproducible example of this:
png("foo.png")
x11()
dev.set(dev.list()[names(dev.list()) == "png:foo.png"])
plot(1:10)
#Make sure you call this afterwards
graphics.off()
Related Topics
Reading Kernel Memory Using a Module
Sed to Loop Through File and Replace Placeholder Variables
How to Get Pyinstaller to Working on Ubuntu
"Nothing to Commit (Working Directory Clean)" When a Folder Has Been Added
Ansible: Copying One Unique File to Each Server in a Group
How to Select a Static Port Number for a Custom App
Generate Disk Usage Graphs/Charts with Cli Only Tools in Linux
Permission Denied: '/Var/Lib/Pgadmin/Sessions' in Docker
How to Disable Greeting Message When Ssh in to a Server
Why Can't I Install Any Packages with Ghc 7.8.4 on Raspberry Pi
Sort a File Based on a Column in Another File
How to Simulate a Iret on Linux X86_64
Set Cron Job for 1St Working Day of Every Month in Shell Scripting
How to Prevent Remote Branch Deletion in Git Without Using Gitolite
Removing File from Folder in Linux
How to Find All Immediate Sub-Directories of The Current Directory on Linux