Backing store when mapping/unmapping an X11 window?
Clash 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
x11
add a comment |Â
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
x11
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 toXSetWindowBackgroundPixmap()
.
â meuh
Aug 26 at 17:59
add a comment |Â
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
x11
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
x11
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 toXSetWindowBackgroundPixmap()
.
â meuh
Aug 26 at 17:59
add a comment |Â
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 toXSetWindowBackgroundPixmap()
.
â 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
add a comment |Â
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
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 yourMapNotify
handler. You useXClearArea()
of one pixel, and it will trigger anExpose
event. Alternatively, you can try creating a syntheticExpose
event and send it usingXSendEvent()
. 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
add a comment |Â
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
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 yourMapNotify
handler. You useXClearArea()
of one pixel, and it will trigger anExpose
event. Alternatively, you can try creating a syntheticExpose
event and send it usingXSendEvent()
. 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
add a comment |Â
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
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 yourMapNotify
handler. You useXClearArea()
of one pixel, and it will trigger anExpose
event. Alternatively, you can try creating a syntheticExpose
event and send it usingXSendEvent()
. 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
add a comment |Â
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
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
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 yourMapNotify
handler. You useXClearArea()
of one pixel, and it will trigger anExpose
event. Alternatively, you can try creating a syntheticExpose
event and send it usingXSendEvent()
. 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
add a comment |Â
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 yourMapNotify
handler. You useXClearArea()
of one pixel, and it will trigger anExpose
event. Alternatively, you can try creating a syntheticExpose
event and send it usingXSendEvent()
. 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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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