All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Ingersoll <ningerso@d.umn.edu>
To: linuxppc-dev@lists.linuxppc.org
Subject: Bug in acceled Xpmac?
Date: Mon, 14 Feb 2000 10:26:38 -0600 (CST)	[thread overview]
Message-ID: <Pine.SO4.4.02.10002140848100.5900-200000@bulldog5.d.umn.edu> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1001 bytes --]

It looks like the accelerated Xpmac that was released in January may have
a bug in mouse handling.

I was working on a small epplet for one button mouse users to make better
use of enlightenment. When using the version of Xpmac that shipped with
LinuxPPC 1999 Q1 it worked fine. But when using the recent accelerated
version, the mouse functionality wouldn't change.

XGetPointerMapping returns the values that were set, but it doesn't seem
to be updating the way it handles the button.

Has anyone else seen similar behavior or know of a fix? I attached the
source of my program for anyone interested in trying it out.

---------------------------------------------------------------------------
|   Nathan Ingersoll             |   Computer Science/Mathematics         |
|   mailto: ningerso@d.umn.edu   |   University of Minnesota-Duluth       |
|   http://umn.edu/~ningerso     |   http://www.d.umn.edu                 |
---------------------------------------------------------------------------

[-- Attachment #2: E-UniButton.c --]
[-- Type: TEXT/PLAIN, Size: 2486 bytes --]

/*
 * Copyright (C) 2000-2001, Nathan Ingersoll
 *
 * This software is licensed under the GNU General Public
 * License. If you did not receive a copy with this software,
 * it may be obtained from http://www.gnu.org/
 */

#include <stdio.h>
#include <unistd.h>
#include "epplet.h"

#define MAXBUTTON 3

Epplet_gadget close_button, label1, label2, button1;
int cur_button;
unsigned char buttons[MAXBUTTON];
char curb[2];
Display *disp;

static void close_cb(void *data);
static void in_cb(void *data, Window w);
static void out_cb(void *data, Window w);
static int delete_cb(void *data, Window win);
static void ok_cb(void *data);

static void
close_cb(void *data)
{
  Epplet_unremember();
  Esync();
  Epplet_cleanup();
  data = NULL;
  exit(0);
}

static void
in_cb(void *data, Window w)
{
  if (w == Epplet_get_main_window()) {
    Epplet_gadget_show(close_button);
  }
  return;
  data = NULL;
}

static void
out_cb(void *data, Window w)
{
  if (w == Epplet_get_main_window()) {
    Epplet_gadget_hide(close_button);
  }
  return;
  data = NULL;
}

static int
delete_cb(void *data, Window win)
{
  win = (Window) 0;
  data = NULL;
  return 1;
}

void
next_button(void *data)
{
   int b;

   XGetPointerMapping(disp, buttons, MAXBUTTON);

   b = buttons[1];
   buttons[1] = buttons[2];
   buttons[2] = buttons[0];
   buttons[0] = b;

   if (XSetPointerMapping(disp, buttons, MAXBUTTON) >= 0) {
	cur_button = buttons[0];
	Esnprintf(curb, 2, "%d", cur_button);
	Epplet_change_label(label2, curb);
   }
}

int
main(int argc, char **argv)
{

  atexit(Epplet_cleanup);

  Epplet_Init("E-UniButton", "0.1", "Mouse Button Changer", 4,3, argc, argv, 0);
  Epplet_load_config();

  disp = Epplet_get_display();
  XGetPointerMapping(disp, buttons, MAXBUTTON);
  cur_button = buttons[0];
  Esnprintf(curb, 2, "%d", cur_button);

  close_button = Epplet_create_std_button("CLOSE", 2, 2, close_cb, (void *)NULL);
  Epplet_gadget_show(label1 = Epplet_create_label(5, 10, "Button:", 3));
  Epplet_gadget_show(label2 = Epplet_create_label(48, 10, curb, 3));
  Epplet_gadget_show(button1 = Epplet_create_text_button("Next", 15, 28, 30, 12,
							next_button, (void *)NULL));
						
  Epplet_register_focus_in_handler(in_cb, NULL);
  Epplet_register_focus_out_handler(out_cb, NULL);
  Epplet_register_delete_event_handler(delete_cb, NULL);

  Epplet_show();
  Epplet_Loop();
  return 0;
}

             reply	other threads:[~2000-02-14 16:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-14 16:26 Nathan Ingersoll [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-02-14 17:45 Bug in acceled Xpmac? Kevin_Hendricks
     [not found] <200002141749.LAA13446@mail.d.umn.edu>
2000-02-14 21:33 ` Nathan Ingersoll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.SO4.4.02.10002140848100.5900-200000@bulldog5.d.umn.edu \
    --to=ningerso@d.umn.edu \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.