Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old May 3, 2016, 11:22   #1
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
x11 - Saving window positions

I just did a MAJOR cleanup of main-x11 - I split the core X11 stuff out leaving main-x11.c as a more Angband Term centric file.

I managed to get rid of practically all of the global variables, apart from metadpy which is kind of a global 'Display' object, so not too fussed about that.

All that ugly xxx_set() crap is gone - side effect being a few more parameters to several functions, but now the code make more sense.

And I fixed the issue with Angband not remembering where you moved windows too - YAY!... BUT... there could be a problem...

Does anyone know what this is all about?
Code:
			/*
			 * This doesn't seem to work under various WMs
			 * since the decoration messes the position up
			 *
			 * Hack -- Use saved window positions.
			 * This means that we won't remember ingame repositioned
			 * windows, but also means that WMs won't screw predefined
			 * positions up. -CJN-
			 */
This:
Code:
			/* Window specific location (x) */
			file_putf(fff, "AT_X_%d=%d\n", i, td->win->x);

			/* Window specific location (y) */
			file_putf(fff, "AT_Y_%d=%d\n", i, td->win->y);
was changed to this:

Code:
			/* Window specific location (x) */
			file_putf(fff, "AT_X_%d=%d\n", i, td->win->x_save);

			/* Window specific location (y) */
			file_putf(fff, "AT_Y_%d=%d\n", i, td->win->y_save);
Now when a window is moved, X Windows generates a ConfigureNotify event which we pick up in CheckEvent(). The handler updates td->win->x and ts->win->y which USED to be saved to the x11 preferences file.

Long short short - if I revert the code, it works perfectly fine on my machine - Fedora, Mutter (Muffin). Question is, which window managers 'didn't work' which resulted in the nuking of a very useful feature?
calris is offline   Reply With Quote
Old May 3, 2016, 20:37   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,932
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by calris View Post
Does anyone know what this is all about? [snip]

Long short short - if I revert the code, it works perfectly fine on my machine - Fedora, Mutter (Muffin). Question is, which window managers 'didn't work' which resulted in the nuking of a very useful feature?
I vaguely remember this. I think the issue was that under some window managers, saving the position and then re-loading with that position actually offsets the windows by however much space the WM's window decorations take up. I could be wrong, though.
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Old May 4, 2016, 05:34   #3
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,367
AnonymousHero is on a distinguished road
Just to add a little to that: WMs under X11 are notoriously inconsistent about this kind of thing. However, I think most major ones should probably be alright at this point. (I think it might be that there's very little in the way of specs or that the extant specs are vague.) Even if they aren't I think it might be better to at least try to put the windows in the right place.
AnonymousHero is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we save the term window positions in x11 calris Vanilla 3 April 2, 2016 21:49
Need advice... X11 vs. SDL Therem Harth Development 25 October 25, 2011 03:35
Remembering subwindow positions Derakon Vanilla 1 June 26, 2010 23:12
Angband under X11 Magnate Vanilla 3 December 13, 2009 21:56
Sound on Linux with X11 is it available. tuppe666 Vanilla 10 September 13, 2007 16:42


All times are GMT +1. The time now is 11:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.