[Bug 196012] New: patches fixing two math/xgraph bugs: XWindow re-size and command line Geometry option

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Dec 16 06:46:38 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196012

            Bug ID: 196012
           Summary: patches fixing two math/xgraph bugs: XWindow re-size
                    and command line Geometry option
           Product: Ports Tree
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: sanpei at FreeBSD.org
          Reporter: jguojun at sbcglobal.net
             Flags: maintainer-feedback?(sanpei at FreeBSD.org)
          Assignee: sanpei at FreeBSD.org

Created attachment 150624
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=150624&action=edit
enhanced FULL patch of patch-ab: original + new patch P1 and P2

math/xgraph has two historical bug and I just got sometime to debug and made
fixes.

Problem 1: xgraph never had window re-size implemented. When re-size xgraph
window, new drawing overlaps old draws. Append patch (P1) gets XWindow re_size
implemented.

Problem 2: command geometry option -- =WxH+X0+Y0 generally does not work. In
most cases, it only takes W, and ignore the H; It is not clear what the
original designer tried to code for. Sent email to xgraph but do not get
response. It looks like this project has been discontinued since Y2K.
Append patch (P2) to fix the compiler directive to separate Bogus formula if
USE_GEOMETRY is defined.

Also, a combined patch -- patch-ab is also attached. 
Do not confuse: patch-ab is a FULL patch that combines P1, P2 and original
patch-ab. This is not third patch.

Since only one file can be attached, so only the full patch -- patch-ab is in
attachment file.
P1 and P2 are pasted below:

--------- patch P1: implementing xgraph XWindow re-size ------------
--- xgraph.c.orig       2000-09-10 07:05:47.000000000 -0700
+++ xgraph.c    2014-12-15 22:32:58.000000000 -0800
@@ -403,6 +402,7 @@
     fg_color = PM_COLOR("Foreground");
     bg_color = PM_COLOR("Background");
     XRecolorCursor(disp, zoomCursor, &fg_color, &bg_color);
+    init_X(win_info->dev_info.user_state);

     Num_Windows = 1;
     while (Num_Windows > 0) {
@@ -415,6 +415,12 @@
            continue;
        }
        switch (theEvent.type) {
+       case ConfigureNotify:
+               win_info->dev_info.area_w = theEvent.xconfigure.width;
+               win_info->dev_info.area_h = theEvent.xconfigure.height;
+               XClearArea(disp, theEvent.xany.window, 1, 1,
win_info->dev_info.area_w, win_info->dev_info.area_h, 0);
+               DrawWindow(win_info);
+               break;
        case Expose:
            if (theEvent.xexpose.count <= 0) {
                XWindowAttributes win_attr;
@@ -422,7 +428,7 @@
                XGetWindowAttributes(disp, theEvent.xany.window, &win_attr);
                win_info->dev_info.area_w = win_attr.width;
                win_info->dev_info.area_h = win_attr.height;
-               init_X(win_info->dev_info.user_state);
+               XClearArea(disp, theEvent.xany.window, 1, 1,
win_info->dev_info.area_w, win_info->dev_info.area_h, 0);
                DrawWindow(win_info);
            }
            break;
@@ -789,7 +796,7 @@

        new_info->flags = 0;
        XSelectInput(disp, new_window,
-                    ExposureMask|KeyPressMask|ButtonPressMask);
+                   
ExposureMask|KeyPressMask|ButtonPressMask|StructureNotifyMask);
        if (!theCursor) {
            theCursor = XCreateFontCursor(disp, XC_top_left_arrow);
            fg_color = PM_COLOR("Foreground");

---------- Patch P2 for fixing =WxH+X0+Y0 command option ------
--- xgraph.c.orig       2000-09-10 07:05:47.000000000 -0700
+++ xgraph.c    2014-12-15 22:32:58.000000000 -0800
@@ -715,7 +721,7 @@
         if (sizehints.x<0) sizehints.x = 0;
         sizehints.y += 25; 
     }
-#endif
+#else

     /* Aspect ratio computation */
     if (asp < 1.0) {
@@ -723,6 +729,7 @@
     } else {
        height = ((int) (((double) NORMSIZE) / asp));
     }
+#endif
     height = MAX(MINDIM, height);
     width = MAX(MINDIM, width);

--- Comment #1 from Bugzilla Automation <bugzilla at FreeBSD.org> ---
Auto-assigned to maintainer sanpei at FreeBSD.org

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list