summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-10-19 06:54:58 +0000
committerElijah Newren <newren@src.gnome.org>2005-10-19 06:54:58 +0000
commit869fcf7ee2e90750584ac2bcf22b2f713be88fc1 (patch)
treeedfe48490b388894643f64faf33d5798cbac7ed4
parent35bcc0b815fbb4863e6b4f6c52da061db30df8eb (diff)
downloadmetacity-869fcf7ee2e90750584ac2bcf22b2f713be88fc1.tar.gz
Update docs, fix up the require onscreen/on-single-xinerama flag
2005-10-19 Elijah Newren <newren@gmail.com> Update docs, fix up the require onscreen/on-single-xinerama flag setting/unsetting. * README: Note that things sorta kinda work now. * constraints-ideas.txt: Add some ideas for fixing some bugs and another bug * src/boxes.[ch] (meta_rectangle_to_string): new printing function * src/constraints.c (update_onscreen_requirements): only apply these to normal windows, remember that these apply to the outer window (i.e. window + frame) not to just the inner window, log some debugging messages when the requirements get toggled, don't forget to remove the struts from the available xinerama area.
-rw-r--r--ChangeLog18
-rw-r--r--README9
-rw-r--r--constraints-ideas.txt43
-rw-r--r--src/boxes.c14
-rw-r--r--src/boxes.h8
-rw-r--r--src/constraints.c47
6 files changed, 119 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a321f12..d1960223 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2005-10-19 Elijah Newren <newren@gmail.com>
+
+ Update docs, fix up the require onscreen/on-single-xinerama flag
+ setting/unsetting.
+
+ * README: Note that things sorta kinda work now.
+
+ * constraints-ideas.txt: Add some ideas for fixing some bugs and
+ another bug
+
+ * src/boxes.[ch] (meta_rectangle_to_string): new printing function
+
+ * src/constraints.c (update_onscreen_requirements): only apply
+ these to normal windows, remember that these apply to the outer
+ window (i.e. window + frame) not to just the inner window, log
+ some debugging messages when the requirements get toggled, don't
+ forget to remove the struts from the available xinerama area.
+
2005-10-17 Elijah Newren <newren@gmail.com>
Get aspect ratio resizing to mostly work, and prevent size
diff --git a/README b/README
index 0b3f1dc2..8c746d7b 100644
--- a/README
+++ b/README
@@ -12,6 +12,15 @@ isn't anywhere close to being debugged (I haven't debugged or tested
anything yet, other than to verify that it doesn't crash on start). I
probably won't break the build again, but no guarantees at this point.
+UPDATE: As of 2005-10-17, not only does it build, but it can kind of be
+used. Kind of. I wouldn't suggest widespread deployment as there are
+still significant regressions, but I'm going to see if it's usable enough
+for me (since I'm more able to avoid the regression bugs that exist than a
+normal user would be able to) to use in my daily work. Some things are
+actually nicer now with this version than the old one, and I'm killing most
+small bugs relatively quickly. One or two of the bugs are going to be a
+major pain to fix, though...
+
Old README file:
diff --git a/constraints-ideas.txt b/constraints-ideas.txt
index d19ea45f..216ab59b 100644
--- a/constraints-ideas.txt
+++ b/constraints-ideas.txt
@@ -1,4 +1,4 @@
-Short-term TODO list/reminders:
+Short-term (I hope...) TODO list/reminders:
- Brokenness left in aspect-ratio resizing:
- gtk+ seems to be doing nit-picky fighting with us over which way to
@@ -9,11 +9,27 @@ Short-term TODO list/reminders:
configure request size using NorthWestGravity instead of
WestGravity--resulting in the window drifting slightly either upward
or downward. sucks.
+ ! Why not just ignore configure requests?
- Interplay between various onscreen constraints is not very good
(resizing should stop when any window edge hits the screen edge,
instead of arbitrarily clipping that edge). Similar problems
probably occur for overlap with other constraints (do we care about
the others, though?).
+ ! Ought to be able to find intersection to any edge of screen (could
+ be 3 sided, not just two) and determine the relevant box size for
+ that. Some care will be needed, e.g. for East/West/North/South
+ gravity where some sides only get increase/2 amount of change
+ instead of increase
+
+ - edge resistance need not be much different than the current code that
+ exists for the keyboard except that (a) only non-covered edges should
+ count (same ought to be true for keyboard moving/resizing as well), (b)
+ it'd be nice to have timeouts (think of two windows, A and B, separated
+ by just a little less than the width of C--it may become really hard
+ without timeouts to place C where it may be wanted), (c) we should add
+ edge stickiness too, (d) it'd be nice to have the pixel-resistance and
+ timeout-resistance be much larger for the screen edges, (e) it may be
+ difficult determining where the screen edges are
- Need to add a test_find_closest_linepoint to testboxes.c to test that
function nice and thoroughly.
@@ -21,32 +37,35 @@ Short-term TODO list/reminders:
- Clicking on an XMMS window causes a failed assertion due to unfixed
FIXME in meta_window_configure_request()
- - Once the window goes offscreen, clicking on the edge in order to
- resize results in all kinds of weirdness: clipping the window to
- the screen, sending the window totally and completely offscreen,
- or who knows what else. Very odd.
-
- Ought to rewrite adjust_for_gravity to do less and then just use
meta_rectangle_resize_with_gravity()
+ - This appears to be related to the breakage of testgravity;
+ configure_request and do_gravity_adjust calls sometimes lie to
+ meta_window_move_resize_internal() and claim that it's
+ NorthWestGravity when it really isn't.
- Ought to add a test_gravity_resize to testboxes.c, and use the new
- meta_rectangle_region_to_string(), and maybe move other printing
- stuff there.
+ meta_rectangle_region_to_string(), and maybe move other printing stuff
+ there.
- Might be good to optimize by storing spanning rects in MetaWorkspace
- - Need to replace xinerama and screen structures (screen.h?) and
- maybe tabpopup stuff (see bug 98340, IIRC) with MetaRectangle's
+ - Need to replace xinerama and screen structures (screen.h?) and maybe
+ tabpopup stuff (see bug 98340, IIRC) with MetaRectangle's
- Need to clean out lots of FIXMEs in the code.
- - Need to do the titlebar offscreen checking, partial maximization,
- etc.
+ - Need to do the titlebar offscreen checking, partial maximization, etc.
- It looks like I can nuke work_area_screen in ConstraintInfo
- Do I need the include_frame parameter to get_size_limits() anymore?
+ X Once the window goes offscreen, clicking on the edge in order to resize
+ results in all kinds of weirdness: clipping the window to the screen,
+ sending the window totally and completely offscreen, or who knows what
+ else. Very odd.
+
X Holy cow, constrain_aspect_ratio is ABSOLUTELY COMPLETELY BORKEN!!!
X Trying to _move_ the window offscreen results in clipping. Huh??
diff --git a/src/boxes.c b/src/boxes.c
index 9035719b..61166775 100644
--- a/src/boxes.c
+++ b/src/boxes.c
@@ -52,6 +52,20 @@ rect2String (const MetaRectangle *rect)
#endif
char*
+meta_rectangle_to_string (const MetaRectangle *rect,
+ char *output)
+{
+ /* 25 = 2 commas, space, plus, trailing \0 + 5 for each digit.
+ * Should be more than enough space. Note that of this space, the
+ * trailing \0 will be overwritten for all but the last rectangle.
+ */
+ snprintf (output, 25, "%d,%d +%d,%d",
+ rect->x, rect->y, rect->width, rect->height);
+
+ return output;
+}
+
+char*
meta_rectangle_region_to_string (GList *region,
const char *separator_string,
char *output)
diff --git a/src/boxes.h b/src/boxes.h
index eca02eba..22d51f74 100644
--- a/src/boxes.h
+++ b/src/boxes.h
@@ -52,9 +52,11 @@ typedef enum
* region_to_string: 1 + (26+strlen(separator_string))*g_list_length (region)
* rect_to_string: 24
*/
-char* meta_rectangle_region_to_string (GList *region,
- const char *separator_string,
- char *output);
+char* meta_rectangle_to_string (const MetaRectangle *rect,
+ char *output);
+char* meta_rectangle_region_to_string (GList *region,
+ const char *separator_string,
+ char *output);
/* Basic comparison functions */
int meta_rectangle_area (const MetaRectangle *rect);
diff --git a/src/constraints.c b/src/constraints.c
index c369f103..07b8f6b1 100644
--- a/src/constraints.c
+++ b/src/constraints.c
@@ -323,12 +323,13 @@ static inline void get_size_limits (const MetaWindow *window,
gboolean include_frame,
MetaRectangle *min_size,
MetaRectangle *max_size);
-static GList* get_screen_relative_spanning_rects (
+static GList* get_screen_relative_spanning_rects (
const MetaScreen *screen,
const int left_expand,
const int right_expand,
const int top_expand,
const int bottom_expand);
+static GSList* get_all_workspace_struts (const MetaWorkspace *workspace);
typedef gboolean (* ConstraintFunc) (MetaWindow *window,
@@ -699,10 +700,17 @@ static void
update_onscreen_requirements (MetaWindow *window,
ConstraintInfo *info)
{
- /* FIXME: Naturally, I only want these flags to become false due to
+ gboolean old;
+
+ /* We only apply the various onscreen requirements to normal windows */
+ if (window->type == META_WINDOW_DESKTOP ||
+ window->type == META_WINDOW_DOCK)
+ return;
+
+ /* FIXME: Naturally, I only want these flags to become *false* due to
* user interactions (which is allowed since certain constraints are
* ignored for user interactions regardless of the setting of these
- * flags). However, do I want these flags to become true due to
+ * flags). However, do I want these flags to become *true* due to
* just an application interaction? It's possible that users may
* find that strange since two application interactions that resize
* in opposite ways don't end up cancelling--but it may also be
@@ -713,22 +721,51 @@ update_onscreen_requirements (MetaWindow *window,
* need to be revisited.
*/
+ /* The require onscreen/on-single-xinerama stuff is relative to the
+ * outer window, not the inner
+ */
+ extend_by_frame (&info->current, info->fgeom);
+
/* Update whether we want future constraint runs to require the
* window to be on fully onscreen.
*/
+ old = window->require_fully_onscreen;
GList *fully_onscreen_region =
get_screen_relative_spanning_rects (window->screen, 0, 0, 0, 0);
window->require_fully_onscreen =
meta_rectangle_contained_in_region (fully_onscreen_region,
&info->current);
+ if (old ^ window->require_fully_onscreen)
+ meta_topic (META_DEBUG_GEOMETRY,
+ "require_fully_onscreen for %s toggled to %s\n"
+ window->desc,
+ window->require_fully_onscreen ? "TRUE" : "FALSE");
meta_rectangle_free_spanning_set (fully_onscreen_region);
/* Update whether we want future constraint runs to require the
* window to be on a single xinerama.
*/
+ old = window->require_on_single_xinerama;
+ GSList *all_struts;
+ GList *single_xinerama_region;
+ all_struts = get_all_workspace_struts (window->screen->active_workspace);
+ single_xinerama_region =
+ meta_rectangle_get_minimal_spanning_set_for_region (&info->entire_xinerama,
+ all_struts,
+ 0, 0, 0, 0);
window->require_on_single_xinerama =
- meta_rectangle_contains_rect (&info->entire_xinerama,
- &info->current);
+ meta_rectangle_contained_in_region (single_xinerama_region,
+ &info->current);
+ if (old ^ window->require_on_single_xinerama)
+ meta_topic (META_DEBUG_GEOMETRY,
+ "require_on_single_xinerama for %s toggled to %s\n",
+ window->desc,
+ window->require_on_single_xinerama ? "TRUE" : "FALSE");
+ meta_rectangle_free_spanning_set (single_xinerama_region);
+ g_slist_free (all_struts);
+
+ /* Don't forget to restore the position of the window */
+ unextend_by_frame (&info->current, info->fgeom);
}
static void