After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671104 - Obvious dead code removal
Obvious dead code removal
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-03-01 06:09 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-05-25 17:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
prefs: Remove live-hidden-windows preference (7.48 KB, patch)
2012-03-01 06:09 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
prefs: Remove a dead declaration (969 bytes, patch)
2012-03-01 06:09 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Remove session saving stuff (68.79 KB, patch)
2012-03-01 06:09 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
Remove meta_compositor_update_remove_geometry (3.02 KB, patch)
2012-03-01 06:09 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
theme-parser: Remove a bunch of dead code (11.36 KB, patch)
2012-03-01 06:09 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
Remove a bunch of dead code (16.05 KB, patch)
2012-03-01 06:09 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
meta-window-actor: Remove some unused constants (928 bytes, patch)
2012-03-13 04:46 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
theme: Remove unused "widget" parameter to frame style drawing (9.71 KB, patch)
2012-03-13 04:46 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
theme: Remove unused entry points (5.87 KB, patch)
2012-03-13 04:46 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
frames: Remove expose_delayed (4.79 KB, patch)
2012-04-30 21:03 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-03-01 06:09:11 UTC
Lots of obvious dead code in mutter. Let's clean it up.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-03-01 06:09:13 UTC
Created attachment 208761 [details] [review]
prefs: Remove live-hidden-windows preference

The preference existed, even though it was hard-coded to true. Just
remove it for good.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-03-01 06:09:15 UTC
Created attachment 208762 [details] [review]
prefs: Remove a dead declaration
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-03-01 06:09:18 UTC
Created attachment 208763 [details] [review]
Remove session saving stuff

It never worked properly, it's been broken for a while, and it's
probably never going to work again. Just remove it, rather than
keep the never-fixed code around.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-03-01 06:09:20 UTC
Created attachment 208764 [details] [review]
Remove meta_compositor_update_remove_geometry

The callback is just dead code
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-03-01 06:09:23 UTC
Created attachment 208765 [details] [review]
theme-parser: Remove a bunch of dead code
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-03-01 06:09:25 UTC
Created attachment 208766 [details] [review]
Remove a bunch of dead code

Code isn't version control. We don't need bug links and commented out
code to remind us of how things were done originally.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-03-13 04:46:33 UTC
Created attachment 209561 [details] [review]
meta-window-actor: Remove some unused constants
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-03-13 04:46:38 UTC
Created attachment 209562 [details] [review]
theme: Remove unused "widget" parameter to frame style drawing

It seems that the only usage of the "widget" parameter throughout
the entire call chain was to pass between two function calls as
mutual recursion.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-03-13 04:46:41 UTC
Created attachment 209563 [details] [review]
theme: Remove unused entry points

meta_draw_op_draw, meta_draw_op_list_draw, and meta_frame_style_draw were
all unused
Comment 10 Owen Taylor 2012-04-24 20:34:22 UTC
Review of attachment 208761 [details] [review]:

OK - don't really want to support two modes of operation if nobody is using one of them
Comment 11 Owen Taylor 2012-04-24 20:35:17 UTC
Review of attachment 208762 [details] [review]:

Yep. (Patch is going to have to be rebased, don't need to see it again.)
Comment 12 Owen Taylor 2012-04-24 20:37:11 UTC
Review of attachment 208763 [details] [review]:

I don't know of evidence for the statement "it never worked properly" - it probably worked as well as any XSMP based session saving could have. I don't want to remove this complex code without a comprehensive plan to entirely remove XSMP session management from GNOME.
Comment 13 Owen Taylor 2012-04-24 20:39:27 UTC
Review of attachment 208764 [details] [review]:

meta_plugin_manager_update_workspace and meta_plugin_manager_update_workspaces( are also unused declarations then
Comment 14 Owen Taylor 2012-04-24 20:42:08 UTC
Review of attachment 208765 [details] [review]:

The #if 0 of the check-expression was some temporary hack from the compositor branch that was accidentally merged? Would like to know more of the history and motivation for this.
Comment 15 Owen Taylor 2012-04-24 20:43:22 UTC
Review of attachment 209561 [details] [review]:

Sure
Comment 16 Owen Taylor 2012-04-24 20:44:20 UTC
Review of attachment 209562 [details] [review]:

OK
Comment 17 Owen Taylor 2012-04-24 20:44:59 UTC
Review of attachment 209563 [details] [review]:

OK
Comment 18 Owen Taylor 2012-04-24 20:45:59 UTC
Review of attachment 209562 [details] [review]:

Marked needs-work by accident
Comment 19 Jasper St. Pierre (not reading bugmail) 2012-04-24 20:55:35 UTC
(In reply to comment #12)
> I don't know of evidence for the statement "it never worked properly" - it
> probably worked as well as any XSMP based session saving could have. I don't
> want to remove this complex code without a comprehensive plan to entirely
> remove XSMP session management from GNOME.

Yes please.
Comment 20 Jasper St. Pierre (not reading bugmail) 2012-04-24 20:57:14 UTC
Attachment 208761 [details] pushed as 2d6555c - prefs: Remove live-hidden-windows preference
Attachment 208762 [details] pushed as 41adbdd - prefs: Remove a dead declaration
Attachment 208766 [details] pushed as 0d794f2 - Remove a bunch of dead code
Attachment 209561 [details] pushed as c0b4d68 - meta-window-actor: Remove some unused constants
Attachment 209562 [details] pushed as b58366d - theme: Remove unused "widget" parameter to frame style drawing
Attachment 209563 [details] pushed as 6900128 - theme: Remove unused entry points


Pushed with suggested changes, excepting theme-parser and session management.

I'll look into theme-parser.
Comment 21 Owen Taylor 2012-04-24 21:25:59 UTC
Review of attachment 208766 [details] [review]:

I don't necessarily agree with the philosophy behind all the removals here even though I often say "code isn't version control" myself. What you never want is a "backwards looking" #if 0 - once you figure out how best to do something, there's no reason to keep the old code around. But a forward-looking #if 0 where there's an open bug, and a description o something that would be better, and some code that shows how it would work but it doesn't quite is fine.

Actually, looking through my comments in detail on the removals, it appears that even backwards looking #if 0's are OK if the old code is a plausible competitor - if there's some reason someone might want to try and reintroduce it.

::: src/core/async-getprop.c
@@ -422,3 @@
-            error.errorCode = BadImplementation;
-
-            _XError (dpy, &error);

I'm indifferent to or slightly against this removal - the #if 0'ed code here doesn't represent anything we'd want to do in the future, but it is quite useful explaining the comment above - in making it clear what else could be done other than storing in task->error.

::: src/core/delete.c
@@ -167,3 @@
-    {
-      /* FIXME Clean this up someday 
-       * http://bugzilla.gnome.org/show_bug.cgi?id=108706

I think this removal is fine, since we went to a never-restack-on-closing-windows policy so the whole thing is pretty much irrelevant.

::: src/core/display.c
@@ -1527,3 @@
-static void
-handle_net_restack_window (MetaDisplay* display,
-                           XEvent *event)

Here this removal doesn't make sense to me - it's illustrative of what we probably should be doing but don't - if someone filed a "Mutter doesn't handle _NET_RESTACK_WINDOW" bug, we'd want this code here to understand the situation.

@@ -3995,3 @@
-  /* FIXME:115072 */
-  /* Don't grab at all unless in click to focus mode. In click to
-   * focus, we may sometimes be clever about intercepting and eating

While what was left here as a comment isn't ideal - there's no actual FIXME here - the conclusion the bug was left at was basically "this is the best we can do between bug 115072 and bug 102209" - but I think having something here is important for showing that there are dragons here and preventing loops- if you want to change this and do something different for mouse focus, you really need to read through the bugzilla bugs.

::: src/core/stack.c
@@ -543,3 @@
-              /* old way of doing it */
-              if (!(meta_window_is_ancestor_of_transient (w, group_window)) &&
-                  !WINDOW_TRANSIENT_FOR_WHOLE_GROUP (group_window))  /* note */;/*note*/

while I don't want to figure this out right now, I think the comments and old code are useful in explaining why it's done the way it is.

::: src/core/testboxes.c
@@ -359,3 @@
-#if 0
-static void
-test_merge_regions ()

I *think* this is just some code that was written while the code in boxes.c was being developed and not a useful test harness, so OK to remove.

@@ -642,3 @@
-  meta_rectangle_region_to_string (region, ", ", tmp_list);
-  printf ("%s vs. %s\n", region_list, tmp_list);
-#endif

This is the kind of code you'd probably comment back in if you were trying to work on this code, so I don't think deleting it is appropriate.

::: src/tools/mutter-window-demo.c
@@ -469,3 @@
-static void
-changing_icon_cb (GtkAction           *action,
-                  gpointer             callback_data)

Fine
Comment 22 Jasper St. Pierre (not reading bugmail) 2012-04-30 20:53:47 UTC
theme-parser comes from:

http://git.gnome.org/browse/metacity/commit/src/theme-parser.c?h=iains-blingtastic-bucket-o-bling&id=1e5ba27a532225d1532fddef50db55343d98e632

So, speed up fixes. Whether we still want them, I don't know.
Comment 23 Jasper St. Pierre (not reading bugmail) 2012-04-30 21:03:26 UTC
Created attachment 213143 [details] [review]
frames: Remove expose_delayed

This was introduced for the effects API and wireframe mode, and was
forgotten when that went the way of the dinosaur.
Comment 24 Owen Taylor 2012-05-21 14:23:13 UTC
Review of attachment 213143 [details] [review]:

Looks good
Comment 25 Jasper St. Pierre (not reading bugmail) 2012-05-25 17:16:07 UTC
Attachment 213143 [details] pushed as fc87a63 - frames: Remove expose_delayed