Backing store when mapping/unmapping an X11 window?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












My X11 client/server are set up to use a backing store (backing_store = WhenMapped), which works fine when my window is partially obscured: remove what's obscuring the window and the now-visible part is refreshed from the backing store with no need for me to repaint...



...but it's not working when the window is unmapped then mapped again: I get UnmapNotify then MapNotify events, but my window is blank when mapped and I have to repaint the whole thing myself.



So my question: How do I get the backing store to work for Unmap/Map as well as Expose? (backing_store = Always) made no difference.



System: Ubuntu 16.04, X.Org X Server 1.19.3



Thank you










share|improve this question





















  • A hack to avoid handling expose events is to create a pixmap of the size of the window and set it as the background pixmap. The server will then refresh from this pixmap. The server is free to make a copy of the pixmap so It is undefined if any changes you make to the pixmap are seen, without doing another call to XSetWindowBackgroundPixmap().
    – meuh
    Aug 26 at 17:59














up vote
3
down vote

favorite












My X11 client/server are set up to use a backing store (backing_store = WhenMapped), which works fine when my window is partially obscured: remove what's obscuring the window and the now-visible part is refreshed from the backing store with no need for me to repaint...



...but it's not working when the window is unmapped then mapped again: I get UnmapNotify then MapNotify events, but my window is blank when mapped and I have to repaint the whole thing myself.



So my question: How do I get the backing store to work for Unmap/Map as well as Expose? (backing_store = Always) made no difference.



System: Ubuntu 16.04, X.Org X Server 1.19.3



Thank you










share|improve this question





















  • A hack to avoid handling expose events is to create a pixmap of the size of the window and set it as the background pixmap. The server will then refresh from this pixmap. The server is free to make a copy of the pixmap so It is undefined if any changes you make to the pixmap are seen, without doing another call to XSetWindowBackgroundPixmap().
    – meuh
    Aug 26 at 17:59












up vote
3
down vote

favorite









up vote
3
down vote

favorite











My X11 client/server are set up to use a backing store (backing_store = WhenMapped), which works fine when my window is partially obscured: remove what's obscuring the window and the now-visible part is refreshed from the backing store with no need for me to repaint...



...but it's not working when the window is unmapped then mapped again: I get UnmapNotify then MapNotify events, but my window is blank when mapped and I have to repaint the whole thing myself.



So my question: How do I get the backing store to work for Unmap/Map as well as Expose? (backing_store = Always) made no difference.



System: Ubuntu 16.04, X.Org X Server 1.19.3



Thank you










share|improve this question













My X11 client/server are set up to use a backing store (backing_store = WhenMapped), which works fine when my window is partially obscured: remove what's obscuring the window and the now-visible part is refreshed from the backing store with no need for me to repaint...



...but it's not working when the window is unmapped then mapped again: I get UnmapNotify then MapNotify events, but my window is blank when mapped and I have to repaint the whole thing myself.



So my question: How do I get the backing store to work for Unmap/Map as well as Expose? (backing_store = Always) made no difference.



System: Ubuntu 16.04, X.Org X Server 1.19.3



Thank you







x11






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 26 at 16:21









ian.macky

161




161











  • A hack to avoid handling expose events is to create a pixmap of the size of the window and set it as the background pixmap. The server will then refresh from this pixmap. The server is free to make a copy of the pixmap so It is undefined if any changes you make to the pixmap are seen, without doing another call to XSetWindowBackgroundPixmap().
    – meuh
    Aug 26 at 17:59
















  • A hack to avoid handling expose events is to create a pixmap of the size of the window and set it as the background pixmap. The server will then refresh from this pixmap. The server is free to make a copy of the pixmap so It is undefined if any changes you make to the pixmap are seen, without doing another call to XSetWindowBackgroundPixmap().
    – meuh
    Aug 26 at 17:59















A hack to avoid handling expose events is to create a pixmap of the size of the window and set it as the background pixmap. The server will then refresh from this pixmap. The server is free to make a copy of the pixmap so It is undefined if any changes you make to the pixmap are seen, without doing another call to XSetWindowBackgroundPixmap().
– meuh
Aug 26 at 17:59




A hack to avoid handling expose events is to create a pixmap of the size of the window and set it as the background pixmap. The server will then refresh from this pixmap. The server is free to make a copy of the pixmap so It is undefined if any changes you make to the pixmap are seen, without doing another call to XSetWindowBackgroundPixmap().
– meuh
Aug 26 at 17:59










1 Answer
1






active

oldest

votes

















up vote
0
down vote













By backing_store = always I presume you mean the window attributes in your client code? But are you sure BackingStore option is enabled for your X server? Presuming Xorg, you should locate your log (/var/log/Xorg.0.log, or more recently ~/.local/share/xorg/Xorg.0.log) and grep for Backing store:



> grep 'Backing store' ~/.local/share/xorg/Xorg.0.log

[ 67.851] (==) intel(0): Backing store enabled


If it's not enabled, you could try creating /etc/X11/xorg.conf.d/10-backing-store.conf (or adding it to an existing file, if you have one with a Device section):



Section "Device"
Option "BackingStore" "on"
EndSection


Restart X and see if the option is enabled in the Xorg.0.log.



There is also the +bs option (note the +) to Xorg itself, which I have used successfully in the past.



> Xorg --help
...
+bs enable any backing store support





share|improve this answer






















  • Hi... The backing store is definitely enabled on the server-- I made sure, which is how I got this far (working for Expose, but not for Map). The log does also verify this: "FBDEV(0): Backing store enabled". So it's working, but not when I unmap then re-map the window.
    – ian.macky
    Aug 27 at 4:51











  • @ian.macky: fair enough, but there is also the window attribute "save-under", which works for Expose but not for Map, so it seemed possible that you were not really testing backing store even for Expose. May I ask what window manager you're using, and whether you've tried this with a different one?
    – flaysomerages
    Aug 28 at 2:54










  • The comment below [this answer] (stackoverflow.com/a/17035752) sounds like it's worth trying, in your MapNotify handler. You use XClearArea() of one pixel, and it will trigger an Expose event. Alternatively, you can try creating a synthetic Expose event and send it using XSendEvent(). Also it should be mentioned, backing store is only a hint to the server, and might not be honored.
    – flaysomerages
    Aug 28 at 19:33










  • Setting save-under/CWSaveUnder doesn't make any difference (just tried it). Note with the backing store enabled, I don't get Expose events when an obscured part of the window is uncovered-- it's just repainted from the backing store and I don't have to deal with it, as expected. With no backing store, I do get Expose events under same conditions. When a window is Unmapped then Mapped, should it start out with the saved contents from the backing store?? Am I barking up the wrong tree? I'm using an ancient window manager but don't see how would WM choice would affect anything.
    – ian.macky
    Aug 29 at 16:01










  • I just checked with an X client of my own, and I do get an expose event when I XUnmapWindow() and then XMapWindow(). (And the bitmap image is restored without redrawing.) So you might like to try the tricks in my previous comment, to force an Expose event on Map? I'm interested in your problem and would like to help, but it's been some time since I messed with this stuff. My app overrides the WM so it might be a bad comparison.
    – flaysomerages
    Aug 29 at 16:22










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464935%2fbacking-store-when-mapping-unmapping-an-x11-window%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













By backing_store = always I presume you mean the window attributes in your client code? But are you sure BackingStore option is enabled for your X server? Presuming Xorg, you should locate your log (/var/log/Xorg.0.log, or more recently ~/.local/share/xorg/Xorg.0.log) and grep for Backing store:



> grep 'Backing store' ~/.local/share/xorg/Xorg.0.log

[ 67.851] (==) intel(0): Backing store enabled


If it's not enabled, you could try creating /etc/X11/xorg.conf.d/10-backing-store.conf (or adding it to an existing file, if you have one with a Device section):



Section "Device"
Option "BackingStore" "on"
EndSection


Restart X and see if the option is enabled in the Xorg.0.log.



There is also the +bs option (note the +) to Xorg itself, which I have used successfully in the past.



> Xorg --help
...
+bs enable any backing store support





share|improve this answer






















  • Hi... The backing store is definitely enabled on the server-- I made sure, which is how I got this far (working for Expose, but not for Map). The log does also verify this: "FBDEV(0): Backing store enabled". So it's working, but not when I unmap then re-map the window.
    – ian.macky
    Aug 27 at 4:51











  • @ian.macky: fair enough, but there is also the window attribute "save-under", which works for Expose but not for Map, so it seemed possible that you were not really testing backing store even for Expose. May I ask what window manager you're using, and whether you've tried this with a different one?
    – flaysomerages
    Aug 28 at 2:54










  • The comment below [this answer] (stackoverflow.com/a/17035752) sounds like it's worth trying, in your MapNotify handler. You use XClearArea() of one pixel, and it will trigger an Expose event. Alternatively, you can try creating a synthetic Expose event and send it using XSendEvent(). Also it should be mentioned, backing store is only a hint to the server, and might not be honored.
    – flaysomerages
    Aug 28 at 19:33










  • Setting save-under/CWSaveUnder doesn't make any difference (just tried it). Note with the backing store enabled, I don't get Expose events when an obscured part of the window is uncovered-- it's just repainted from the backing store and I don't have to deal with it, as expected. With no backing store, I do get Expose events under same conditions. When a window is Unmapped then Mapped, should it start out with the saved contents from the backing store?? Am I barking up the wrong tree? I'm using an ancient window manager but don't see how would WM choice would affect anything.
    – ian.macky
    Aug 29 at 16:01










  • I just checked with an X client of my own, and I do get an expose event when I XUnmapWindow() and then XMapWindow(). (And the bitmap image is restored without redrawing.) So you might like to try the tricks in my previous comment, to force an Expose event on Map? I'm interested in your problem and would like to help, but it's been some time since I messed with this stuff. My app overrides the WM so it might be a bad comparison.
    – flaysomerages
    Aug 29 at 16:22














up vote
0
down vote













By backing_store = always I presume you mean the window attributes in your client code? But are you sure BackingStore option is enabled for your X server? Presuming Xorg, you should locate your log (/var/log/Xorg.0.log, or more recently ~/.local/share/xorg/Xorg.0.log) and grep for Backing store:



> grep 'Backing store' ~/.local/share/xorg/Xorg.0.log

[ 67.851] (==) intel(0): Backing store enabled


If it's not enabled, you could try creating /etc/X11/xorg.conf.d/10-backing-store.conf (or adding it to an existing file, if you have one with a Device section):



Section "Device"
Option "BackingStore" "on"
EndSection


Restart X and see if the option is enabled in the Xorg.0.log.



There is also the +bs option (note the +) to Xorg itself, which I have used successfully in the past.



> Xorg --help
...
+bs enable any backing store support





share|improve this answer






















  • Hi... The backing store is definitely enabled on the server-- I made sure, which is how I got this far (working for Expose, but not for Map). The log does also verify this: "FBDEV(0): Backing store enabled". So it's working, but not when I unmap then re-map the window.
    – ian.macky
    Aug 27 at 4:51











  • @ian.macky: fair enough, but there is also the window attribute "save-under", which works for Expose but not for Map, so it seemed possible that you were not really testing backing store even for Expose. May I ask what window manager you're using, and whether you've tried this with a different one?
    – flaysomerages
    Aug 28 at 2:54










  • The comment below [this answer] (stackoverflow.com/a/17035752) sounds like it's worth trying, in your MapNotify handler. You use XClearArea() of one pixel, and it will trigger an Expose event. Alternatively, you can try creating a synthetic Expose event and send it using XSendEvent(). Also it should be mentioned, backing store is only a hint to the server, and might not be honored.
    – flaysomerages
    Aug 28 at 19:33










  • Setting save-under/CWSaveUnder doesn't make any difference (just tried it). Note with the backing store enabled, I don't get Expose events when an obscured part of the window is uncovered-- it's just repainted from the backing store and I don't have to deal with it, as expected. With no backing store, I do get Expose events under same conditions. When a window is Unmapped then Mapped, should it start out with the saved contents from the backing store?? Am I barking up the wrong tree? I'm using an ancient window manager but don't see how would WM choice would affect anything.
    – ian.macky
    Aug 29 at 16:01










  • I just checked with an X client of my own, and I do get an expose event when I XUnmapWindow() and then XMapWindow(). (And the bitmap image is restored without redrawing.) So you might like to try the tricks in my previous comment, to force an Expose event on Map? I'm interested in your problem and would like to help, but it's been some time since I messed with this stuff. My app overrides the WM so it might be a bad comparison.
    – flaysomerages
    Aug 29 at 16:22












up vote
0
down vote










up vote
0
down vote









By backing_store = always I presume you mean the window attributes in your client code? But are you sure BackingStore option is enabled for your X server? Presuming Xorg, you should locate your log (/var/log/Xorg.0.log, or more recently ~/.local/share/xorg/Xorg.0.log) and grep for Backing store:



> grep 'Backing store' ~/.local/share/xorg/Xorg.0.log

[ 67.851] (==) intel(0): Backing store enabled


If it's not enabled, you could try creating /etc/X11/xorg.conf.d/10-backing-store.conf (or adding it to an existing file, if you have one with a Device section):



Section "Device"
Option "BackingStore" "on"
EndSection


Restart X and see if the option is enabled in the Xorg.0.log.



There is also the +bs option (note the +) to Xorg itself, which I have used successfully in the past.



> Xorg --help
...
+bs enable any backing store support





share|improve this answer














By backing_store = always I presume you mean the window attributes in your client code? But are you sure BackingStore option is enabled for your X server? Presuming Xorg, you should locate your log (/var/log/Xorg.0.log, or more recently ~/.local/share/xorg/Xorg.0.log) and grep for Backing store:



> grep 'Backing store' ~/.local/share/xorg/Xorg.0.log

[ 67.851] (==) intel(0): Backing store enabled


If it's not enabled, you could try creating /etc/X11/xorg.conf.d/10-backing-store.conf (or adding it to an existing file, if you have one with a Device section):



Section "Device"
Option "BackingStore" "on"
EndSection


Restart X and see if the option is enabled in the Xorg.0.log.



There is also the +bs option (note the +) to Xorg itself, which I have used successfully in the past.



> Xorg --help
...
+bs enable any backing store support






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 7 at 22:56









Rui F Ribeiro

36.7k1271117




36.7k1271117










answered Aug 26 at 17:29









flaysomerages

1225




1225











  • Hi... The backing store is definitely enabled on the server-- I made sure, which is how I got this far (working for Expose, but not for Map). The log does also verify this: "FBDEV(0): Backing store enabled". So it's working, but not when I unmap then re-map the window.
    – ian.macky
    Aug 27 at 4:51











  • @ian.macky: fair enough, but there is also the window attribute "save-under", which works for Expose but not for Map, so it seemed possible that you were not really testing backing store even for Expose. May I ask what window manager you're using, and whether you've tried this with a different one?
    – flaysomerages
    Aug 28 at 2:54










  • The comment below [this answer] (stackoverflow.com/a/17035752) sounds like it's worth trying, in your MapNotify handler. You use XClearArea() of one pixel, and it will trigger an Expose event. Alternatively, you can try creating a synthetic Expose event and send it using XSendEvent(). Also it should be mentioned, backing store is only a hint to the server, and might not be honored.
    – flaysomerages
    Aug 28 at 19:33










  • Setting save-under/CWSaveUnder doesn't make any difference (just tried it). Note with the backing store enabled, I don't get Expose events when an obscured part of the window is uncovered-- it's just repainted from the backing store and I don't have to deal with it, as expected. With no backing store, I do get Expose events under same conditions. When a window is Unmapped then Mapped, should it start out with the saved contents from the backing store?? Am I barking up the wrong tree? I'm using an ancient window manager but don't see how would WM choice would affect anything.
    – ian.macky
    Aug 29 at 16:01










  • I just checked with an X client of my own, and I do get an expose event when I XUnmapWindow() and then XMapWindow(). (And the bitmap image is restored without redrawing.) So you might like to try the tricks in my previous comment, to force an Expose event on Map? I'm interested in your problem and would like to help, but it's been some time since I messed with this stuff. My app overrides the WM so it might be a bad comparison.
    – flaysomerages
    Aug 29 at 16:22
















  • Hi... The backing store is definitely enabled on the server-- I made sure, which is how I got this far (working for Expose, but not for Map). The log does also verify this: "FBDEV(0): Backing store enabled". So it's working, but not when I unmap then re-map the window.
    – ian.macky
    Aug 27 at 4:51











  • @ian.macky: fair enough, but there is also the window attribute "save-under", which works for Expose but not for Map, so it seemed possible that you were not really testing backing store even for Expose. May I ask what window manager you're using, and whether you've tried this with a different one?
    – flaysomerages
    Aug 28 at 2:54










  • The comment below [this answer] (stackoverflow.com/a/17035752) sounds like it's worth trying, in your MapNotify handler. You use XClearArea() of one pixel, and it will trigger an Expose event. Alternatively, you can try creating a synthetic Expose event and send it using XSendEvent(). Also it should be mentioned, backing store is only a hint to the server, and might not be honored.
    – flaysomerages
    Aug 28 at 19:33










  • Setting save-under/CWSaveUnder doesn't make any difference (just tried it). Note with the backing store enabled, I don't get Expose events when an obscured part of the window is uncovered-- it's just repainted from the backing store and I don't have to deal with it, as expected. With no backing store, I do get Expose events under same conditions. When a window is Unmapped then Mapped, should it start out with the saved contents from the backing store?? Am I barking up the wrong tree? I'm using an ancient window manager but don't see how would WM choice would affect anything.
    – ian.macky
    Aug 29 at 16:01










  • I just checked with an X client of my own, and I do get an expose event when I XUnmapWindow() and then XMapWindow(). (And the bitmap image is restored without redrawing.) So you might like to try the tricks in my previous comment, to force an Expose event on Map? I'm interested in your problem and would like to help, but it's been some time since I messed with this stuff. My app overrides the WM so it might be a bad comparison.
    – flaysomerages
    Aug 29 at 16:22















Hi... The backing store is definitely enabled on the server-- I made sure, which is how I got this far (working for Expose, but not for Map). The log does also verify this: "FBDEV(0): Backing store enabled". So it's working, but not when I unmap then re-map the window.
– ian.macky
Aug 27 at 4:51





Hi... The backing store is definitely enabled on the server-- I made sure, which is how I got this far (working for Expose, but not for Map). The log does also verify this: "FBDEV(0): Backing store enabled". So it's working, but not when I unmap then re-map the window.
– ian.macky
Aug 27 at 4:51













@ian.macky: fair enough, but there is also the window attribute "save-under", which works for Expose but not for Map, so it seemed possible that you were not really testing backing store even for Expose. May I ask what window manager you're using, and whether you've tried this with a different one?
– flaysomerages
Aug 28 at 2:54




@ian.macky: fair enough, but there is also the window attribute "save-under", which works for Expose but not for Map, so it seemed possible that you were not really testing backing store even for Expose. May I ask what window manager you're using, and whether you've tried this with a different one?
– flaysomerages
Aug 28 at 2:54












The comment below [this answer] (stackoverflow.com/a/17035752) sounds like it's worth trying, in your MapNotify handler. You use XClearArea() of one pixel, and it will trigger an Expose event. Alternatively, you can try creating a synthetic Expose event and send it using XSendEvent(). Also it should be mentioned, backing store is only a hint to the server, and might not be honored.
– flaysomerages
Aug 28 at 19:33




The comment below [this answer] (stackoverflow.com/a/17035752) sounds like it's worth trying, in your MapNotify handler. You use XClearArea() of one pixel, and it will trigger an Expose event. Alternatively, you can try creating a synthetic Expose event and send it using XSendEvent(). Also it should be mentioned, backing store is only a hint to the server, and might not be honored.
– flaysomerages
Aug 28 at 19:33












Setting save-under/CWSaveUnder doesn't make any difference (just tried it). Note with the backing store enabled, I don't get Expose events when an obscured part of the window is uncovered-- it's just repainted from the backing store and I don't have to deal with it, as expected. With no backing store, I do get Expose events under same conditions. When a window is Unmapped then Mapped, should it start out with the saved contents from the backing store?? Am I barking up the wrong tree? I'm using an ancient window manager but don't see how would WM choice would affect anything.
– ian.macky
Aug 29 at 16:01




Setting save-under/CWSaveUnder doesn't make any difference (just tried it). Note with the backing store enabled, I don't get Expose events when an obscured part of the window is uncovered-- it's just repainted from the backing store and I don't have to deal with it, as expected. With no backing store, I do get Expose events under same conditions. When a window is Unmapped then Mapped, should it start out with the saved contents from the backing store?? Am I barking up the wrong tree? I'm using an ancient window manager but don't see how would WM choice would affect anything.
– ian.macky
Aug 29 at 16:01












I just checked with an X client of my own, and I do get an expose event when I XUnmapWindow() and then XMapWindow(). (And the bitmap image is restored without redrawing.) So you might like to try the tricks in my previous comment, to force an Expose event on Map? I'm interested in your problem and would like to help, but it's been some time since I messed with this stuff. My app overrides the WM so it might be a bad comparison.
– flaysomerages
Aug 29 at 16:22




I just checked with an X client of my own, and I do get an expose event when I XUnmapWindow() and then XMapWindow(). (And the bitmap image is restored without redrawing.) So you might like to try the tricks in my previous comment, to force an Expose event on Map? I'm interested in your problem and would like to help, but it's been some time since I messed with this stuff. My app overrides the WM so it might be a bad comparison.
– flaysomerages
Aug 29 at 16:22

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464935%2fbacking-store-when-mapping-unmapping-an-x11-window%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay